1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

fix a potential crash bug

This commit is contained in:
Zeno Rogue 2018-07-27 22:14:46 +02:00
parent d32fe9192e
commit 4ae3733659

View File

@ -800,9 +800,6 @@ void init_textureconfig() {
addsaver(patterns::whichPattern, "pattern", 0); addsaver(patterns::whichPattern, "pattern", 0);
addsaver(patterns::subpattern_flags, "pattern flags", 0); addsaver(patterns::subpattern_flags, "pattern flags", 0);
cell *ctr = euclid ? centerover.c : viewctr.h->c7;
si_save = patterns::getpatterninfo0(ctr);
addsaver(si_save.id, "center type", 1); addsaver(si_save.id, "center type", 1);
addsaver(si_save.dir, "center direction", 0); addsaver(si_save.dir, "center direction", 0);
addsaver(si_save.reflect, "center reflection", false); addsaver(si_save.reflect, "center reflection", false);
@ -844,6 +841,9 @@ bool texture_config::save() {
targetgeometry = geometry; targetgeometry = geometry;
target_nonbitru = nonbitrunc; target_nonbitru = nonbitrunc;
cell *ctr = euclid ? centerover.c : viewctr.h->c7;
si_save = patterns::getpatterninfo0(ctr);
for(auto s: texturesavers) if(s->dosave()) for(auto s: texturesavers) if(s->dosave())
fprintf(f, "%s=%s\n", s->name.c_str(), s->save().c_str()); fprintf(f, "%s=%s\n", s->name.c_str(), s->save().c_str());