diff options
Diffstat (limited to 'src/gui/game/GameController.cpp')
| -rw-r--r-- | src/gui/game/GameController.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index b6d0560..a114b82 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -749,7 +749,7 @@ void GameController::ResetSpark() if (sim->parts[i].ctype >= 0 && sim->parts[i].ctype < PT_NUM && sim->elements[sim->parts[i].ctype].Enabled) { sim->parts[i].type = sim->parts[i].ctype; - sim->parts[i].life = 0; + sim->parts[i].ctype = sim->parts[i].life = 0; } else sim->kill_part(i); @@ -1389,6 +1389,16 @@ std::string GameController::ElementResolve(int type, int ctype) return ""; } +bool GameController::IsValidElement(int type) +{ + if(gameModel && gameModel->GetSimulation()) + { + return (type > 0 && type < PT_NUM && gameModel->GetSimulation()->elements[type].Enabled); + } + else + return false; +} + std::string GameController::WallName(int type) { if(gameModel && gameModel->GetSimulation() && gameModel->GetSimulation()->wtypes && type >= 0 && type < UI_WALLCOUNT) |
