From 843f4142916310aba13226479a2c31081306b4f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Sat, 13 May 2023 12:02:03 +0200 Subject: [PATCH] Fix scary mutant spiders (many-headed stickmen) They would sometimes show up in intentionally or otherwise corrupted saves. --- src/simulation/Simulation.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 7524d5afb..d9dd068b9 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -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;