From 16e4c5f7179db5beabe3065781adec7d27000cd9 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 15 Nov 2012 20:41:38 -0500 Subject: [PATCH] save pause state in stamps, load pause state from local saves and stamps correctly, remove accidental inclusion --- src/cat/TPTScriptInterface.cpp | 2 +- src/game/GameController.cpp | 8 +++++++- src/game/GameModel.cpp | 2 +- src/simulation/elements/FIRE.cpp | 6 ------ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/cat/TPTScriptInterface.cpp b/src/cat/TPTScriptInterface.cpp index 47828383f..684467fbf 100644 --- a/src/cat/TPTScriptInterface.cpp +++ b/src/cat/TPTScriptInterface.cpp @@ -219,7 +219,7 @@ AnyType TPTScriptInterface::tptS_set(std::deque * words) newValue = GetParticleType(((StringType)value).Value()); if (newValue < 0 || newValue >= PT_NUM) { - if (((StringType)value).Value() == "GOLD") + if (((StringType)value).Value() == "GOLD" || ((StringType)value).Value() == "gold") throw GeneralException("No, GOLD will not be an element"); else throw GeneralException("Invalid element"); diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index 0f3d92e18..0cff7d2c9 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -240,7 +240,7 @@ void GameController::PlaceSave(ui::Point position) if(gameModel->GetPlaceSave()) { gameModel->GetSimulation()->Load(position.X, position.Y, gameModel->GetPlaceSave()); - gameModel->SetPaused(gameModel->GetPaused()); + gameModel->SetPaused(gameModel->GetPlaceSave()->paused | gameModel->GetPaused()); } } @@ -489,7 +489,10 @@ void GameController::StampRegion(ui::Point point1, ui::Point point2) GameSave * newSave; newSave = gameModel->GetSimulation()->Save(point1.X, point1.Y, point2.X, point2.Y); if(newSave) + { + newSave->paused = gameModel->GetPaused(); gameModel->AddStamp(newSave); + } else new ErrorMessage("Could not create stamp", "Error generating save file"); } @@ -499,7 +502,10 @@ void GameController::CopyRegion(ui::Point point1, ui::Point point2) GameSave * newSave; newSave = gameModel->GetSimulation()->Save(point1.X, point1.Y, point2.X, point2.Y); if(newSave) + { + newSave->paused = gameModel->GetPaused(); gameModel->SetClipboard(newSave); + } } void GameController::CutRegion(ui::Point point1, ui::Point point2) diff --git a/src/game/GameModel.cpp b/src/game/GameModel.cpp index 4a11d5520..774d63623 100644 --- a/src/game/GameModel.cpp +++ b/src/game/GameModel.cpp @@ -587,7 +587,7 @@ void GameModel::SetSaveFile(SaveFile * newSave) if(newSave && newSave->GetGameSave()) { GameSave * saveData = newSave->GetGameSave(); - SetPaused(saveData->paused & GetPaused()); + SetPaused(saveData->paused | GetPaused()); sim->gravityMode = saveData->gravityMode; sim->air->airMode = saveData->airMode; sim->legacy_enable = saveData->legacyEnable; diff --git a/src/simulation/elements/FIRE.cpp b/src/simulation/elements/FIRE.cpp index 538bd05ab..f9313fa97 100644 --- a/src/simulation/elements/FIRE.cpp +++ b/src/simulation/elements/FIRE.cpp @@ -96,12 +96,6 @@ int Element_FIRE::update(UPDATE_FUNC_ARGS) (rt!=PT_SPNG || parts[r>>8].life==0) && sim->elements[rt].Flammable && (sim->elements[rt].Flammable + (int)(sim->pv[(y+ry)/CELL][(x+rx)/CELL]*10.0f))>(rand()%1000)) { - int j = sim->create_part(-1, x-1+rand()%3, y-1+rand()%3, PT_SMKE); - if (j != -1) - { - parts[r>>8].temp = restrict_flt(sim->elements[PT_FIRE].Temperature + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP); - parts[j].life = rand()%80+480; - } sim->part_change_type(r>>8,x+rx,y+ry,PT_FIRE); parts[r>>8].temp = restrict_flt(sim->elements[PT_FIRE].Temperature + (sim->elements[rt].Flammable/2), MIN_TEMP, MAX_TEMP); parts[r>>8].life = rand()%80+180;