diff options
Diffstat (limited to 'src/game/GameController.cpp')
| -rw-r--r-- | src/game/GameController.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index f289f49..4f94ab8 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -580,6 +580,9 @@ void GameController::ReloadSim() std::string GameController::ElementResolve(int type) { - return std::string(gameModel->GetSimulation()->ptypes[type].name); + if(gameModel && gameModel->GetSimulation() && gameModel->GetSimulation()->ptypes && type >= 0 && type < PT_NUM) + return std::string(gameModel->GetSimulation()->ptypes[type].name); + else + return ""; } |
