Skip to content

Commit

Permalink
force a stacking check when undoing (id:1997880)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Jun 11, 2016
1 parent fbd75c6 commit d63c601
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/simulation/Simulation.cpp
Expand Up @@ -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++)
{
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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++)
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/Simulation.h
Expand Up @@ -60,7 +60,7 @@ class Simulation
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;
Expand Down

0 comments on commit d63c601

Please sign in to comment.