Update elementCount when restoring a snapshot (fixes #592)

This commit is contained in:
Tamás Bálint Misius 2021-04-18 15:48:10 +02:00
parent 8590a74785
commit 11f6abdfca
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -4719,9 +4719,6 @@ void Simulation::RecalcFreeParticles(bool do_life_dec)
continue; continue;
} }
if (elementRecount)
elementCount[t]++;
unsigned int elem_properties = elements[t].Properties; 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)) 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; continue;
} }
} }
if (elementRecount)
elementCount[t]++;
} }
else else
{ {