summaryrefslogtreecommitdiff
path: root/src/gui/game/PropertyTool.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-05-12 02:29:24 (GMT)
committer jacob1 <jfu614@gmail.com>2013-05-12 02:29:24 (GMT)
commit135bf443478dac8f4141dcbbb8fb1aced7731be1 (patch)
treede3db920455205eaa1be4276d3f1311c3dcef10c /src/gui/game/PropertyTool.cpp
parent51f27bfad72e7fbc72388f63c3b8a48162e509a1 (diff)
downloadpowder-135bf443478dac8f4141dcbbb8fb1aced7731be1.zip
powder-135bf443478dac8f4141dcbbb8fb1aced7731be1.tar.gz
fix bug where you could set invalid types with PROP
Diffstat (limited to 'src/gui/game/PropertyTool.cpp')
-rw-r--r--src/gui/game/PropertyTool.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/game/PropertyTool.cpp b/src/gui/game/PropertyTool.cpp
index aff535e..6c9bf26 100644
--- a/src/gui/game/PropertyTool.cpp
+++ b/src/gui/game/PropertyTool.cpp
@@ -139,6 +139,11 @@ void PropertyWindow::SetProperty()
buffer.exceptions(std::stringstream::failbit | std::stringstream::badbit);
buffer >> tempInt;
}
+ if (property->GetOption().first == "type" && (tempInt < 0 || tempInt >= PT_NUM))
+ {
+ new ErrorMessage("Could not set property", "Invalid Particle Type");
+ return;
+ }
}
else
{
@@ -193,6 +198,7 @@ void PropertyWindow::SetProperty()
break;
default:
new ErrorMessage("Could not set property", "Invalid property");
+ return;
}
sim->flood_prop(
position.X,