mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 11:19:51 +02:00
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:
@@ -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++)
|
||||
{
|
||||
|
Reference in New Issue
Block a user