Preserve stacked particles in saves being placed (fixes #743)

This commit is contained in:
Tamás Bálint Misius 2020-11-16 12:53:58 +01:00
parent 2273233b71
commit 86a621741d
No known key found for this signature in database
GPG Key ID: 5B472A12F6ECA9F2

View File

@ -156,6 +156,10 @@ int Simulation::Load(GameSave * save, bool includePressure, int fullX, int fullY
parts[ID(r)] = tempPart;
i = ID(r);
elementCount[tempPart.type]++;
// * pmap will be repopulated a bit later by RecalcFreeParticles;
// until then, remove the entry so the next new particle at the
// same position doesn't overwrite the one we've just copied
pmap[y][x] = 0;
}
else if ((r = photons[y][x]))
{
@ -163,6 +167,8 @@ int Simulation::Load(GameSave * save, bool includePressure, int fullX, int fullY
parts[ID(r)] = tempPart;
i = ID(r);
elementCount[tempPart.type]++;
// * same as with pmap above
photons[y][x] = 0;
}
//Allocate new particle
else