summaryrefslogtreecommitdiff
path: root/src/gui/game/GameController.cpp
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2013-09-08 08:21:08 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2013-09-08 08:26:31 (GMT)
commit79edfe9589c4b82ce320e0ae88d043b66b14f570 (patch)
tree476541f19227f01da686f9462d9f5b3fda685a35 /src/gui/game/GameController.cpp
parent8d96f3f6b6a872956cac4217c4a8f56d6316738b (diff)
downloadpowder-79edfe9589c4b82ce320e0ae88d043b66b14f570.zip
powder-79edfe9589c4b82ce320e0ae88d043b66b14f570.tar.gz
Include elements[].Enabled in check for invalid lava ctype
Diffstat (limited to 'src/gui/game/GameController.cpp')
-rw-r--r--src/gui/game/GameController.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp
index 1235848..a114b82 100644
--- a/src/gui/game/GameController.cpp
+++ b/src/gui/game/GameController.cpp
@@ -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)