From 4ae3733659682d191d94f8ca4d3a2f2893a3f5e7 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 27 Jul 2018 22:14:46 +0200 Subject: [PATCH] fix a potential crash bug --- textures.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/textures.cpp b/textures.cpp index a226331d..d6fea4ed 100644 --- a/textures.cpp +++ b/textures.cpp @@ -800,9 +800,6 @@ void init_textureconfig() { addsaver(patterns::whichPattern, "pattern", 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.dir, "center direction", 0); addsaver(si_save.reflect, "center reflection", false); @@ -844,6 +841,9 @@ bool texture_config::save() { targetgeometry = geometry; target_nonbitru = nonbitrunc; + cell *ctr = euclid ? centerover.c : viewctr.h->c7; + si_save = patterns::getpatterninfo0(ctr); + for(auto s: texturesavers) if(s->dosave()) fprintf(f, "%s=%s\n", s->name.c_str(), s->save().c_str());