From 11f6abdfca00af9854a0fc8b5ae6e6ce30045d90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Sun, 18 Apr 2021 15:48:10 +0200 Subject: [PATCH] Update elementCount when restoring a snapshot (fixes #592) --- src/simulation/Simulation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index a44b55a74..477d7f653 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -4719,9 +4719,6 @@ void Simulation::RecalcFreeParticles(bool do_life_dec) continue; } - if (elementRecount) - elementCount[t]++; - unsigned int elem_properties = elements[t].Properties; if (parts[i].life>0 && (elem_properties&PROP_LIFE_DEC) && !(inBounds && bmap[y/CELL][x/CELL] == WL_STASIS && emap[y/CELL][x/CELL]<8)) { @@ -4741,6 +4738,9 @@ void Simulation::RecalcFreeParticles(bool do_life_dec) continue; } } + + if (elementRecount) + elementCount[t]++; } else {