From d63c6012c679b0451444eebd7065b4c37a3cf87f Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 11 Jun 2016 10:20:25 -0400 Subject: [PATCH] force a stacking check when undoing (id:1997880) --- src/simulation/Simulation.cpp | 9 +++++---- src/simulation/Simulation.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 0c5f4cf25..79d6241f7 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -167,7 +167,7 @@ int Simulation::Load(int fullX, int fullY, GameSave * save) } } parts_lastActiveIndex = NPART-1; - force_stacking_check = 1; + force_stacking_check = true; Element_PPIP::ppip_changed = 1; for (size_t i = 0; i < save->signs.size() && signs.size() < MAXSIGNS; i++) { @@ -332,8 +332,9 @@ Snapshot * Simulation::CreateSnapshot() void Simulation::Restore(const Snapshot & snap) { - parts_lastActiveIndex = NPART-1; + parts_lastActiveIndex = NPART-1; elementRecount = true; + force_stacking_check = true; std::copy(snap.AirPressure.begin(), snap.AirPressure.end(), &pv[0][0]); std::copy(snap.AirVelocityX.begin(), snap.AirVelocityX.end(), &vx[0][0]); @@ -4717,7 +4718,7 @@ void Simulation::SimulateGoL() void Simulation::CheckStacking() { bool excessive_stacking_found = false; - force_stacking_check = 0; + force_stacking_check = false; for (int y = 0; y < YRES; y++) { for (int x = 0; x < XRES; x++) @@ -5074,7 +5075,7 @@ Simulation::Simulation(): replaceModeFlags(0), debug_currentParticle(0), ISWIRE(0), - force_stacking_check(0), + force_stacking_check(false), emp_decor(0), emp_trigger_count(0), etrd_count_valid(false), diff --git a/src/simulation/Simulation.h b/src/simulation/Simulation.h index aa54dfee7..f91b958e2 100644 --- a/src/simulation/Simulation.h +++ b/src/simulation/Simulation.h @@ -60,7 +60,7 @@ public: bool elementRecount; int elementCount[PT_NUM]; int ISWIRE; - int force_stacking_check; + bool force_stacking_check; int emp_decor; int emp_trigger_count; bool etrd_count_valid;