Disable pretty powders while loading saves

This should and indeed mostly does not have any observable effect because any particle created with create_part for being loaded from a save is overwritten with data from the save anyway. However, if pretty powders is on, create_part uses Simulation::rng to make powders pretty, and that just gets in the way of debugging when relying on determinism.
This commit is contained in:
Tamás Bálint Misius
2025-06-12 19:15:14 +02:00
parent 8c321a03bb
commit 7c3f922406

View File

@@ -8,6 +8,7 @@
#include "client/GameSave.h"
#include "common/tpt-compat.h"
#include "common/tpt-rand.h"
#include "common/Defer.h"
#include "gui/game/Brush.h"
#include "elements/EMP.h"
#include "elements/LOLZ.h"
@@ -78,6 +79,11 @@ void Simulation::Load(const GameSave *save, bool includePressure, Vec2<int> bloc
}
};
auto oldPrettyPowders = pretty_powder;
pretty_powder = false;
Defer restorePrettyPowders([this, oldPrettyPowders]() {
pretty_powder = oldPrettyPowders;
});
std::map<unsigned int, unsigned int> soapList;
for (int n = 0; n < NPART && n < save->particlesCount; n++)
{