From 510cbd63b5ed92e86b5c133605d246951442c84b Mon Sep 17 00:00:00 2001 From: jacob1 Date: Mon, 17 Dec 2012 19:41:32 -0500 Subject: [PATCH] fix GLAS and QRTZ sometimes breaking when pasting stamps or resetting pressure --- src/game/GameController.cpp | 10 +++++++++- src/simulation/Simulation.cpp | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index e56ae50f9..07d2e63c2 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -702,7 +702,15 @@ void GameController::Exit() void GameController::ResetAir() { - gameModel->GetSimulation()->air->Clear(); + Simulation * sim = gameModel->GetSimulation(); + sim->air->Clear(); + for (int i = 0; i < NPART; i++) + { + if (sim->parts[i].type == PT_QRTZ || sim->parts[i].type == PT_GLAS) + { + sim->parts[i].pavg[0] = sim->parts[i].pavg[1] = 0; + } + } } void GameController::ResetSpark() diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 21f810938..afb50c57f 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -136,6 +136,10 @@ int Simulation::Load(int fullX, int fullY, GameSave * save) } } } + if (parts[i].pavg[0] || parts[i].pavg[1]) + { + parts[i].pavg[0] = parts[i].pavg[1] = 0; + } } parts_lastActiveIndex = NPART-1; force_stacking_check = 1;