Fix scary mutant spiders (many-headed stickmen)

They would sometimes show up in intentionally or otherwise corrupted saves.
This commit is contained in:
Tamás Bálint Misius
2023-05-13 12:02:03 +02:00
parent d8acdfb576
commit 843f414291

View File

@@ -171,6 +171,14 @@ int Simulation::Load(const GameSave * originalSave, bool includePressure, int fu
{
Particle tempPart = save->particles[n];
if (elements[tempPart.type].CreateAllowed)
{
if (!(*(elements[tempPart.type].CreateAllowed))(this, -3, int(tempPart.x + 0.5f), int(tempPart.y + 0.5f), tempPart.type))
{
continue;
}
}
// Allocate particle (this location is guaranteed to be empty due to "full scan" logic above)
if (pfree == -1)
break;