summaryrefslogtreecommitdiff
path: root/src/gui/game/PropertyTool.cpp
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-05-17 16:44:25 (GMT)
committer jacob1 <jfu614@gmail.com>2013-05-17 16:44:25 (GMT)
commit981f6984c2c0f87d54a9c90f4518c69c9ef02ae0 (patch)
tree757bd699a23c1fad61e60700265a25feb1a3042c /src/gui/game/PropertyTool.cpp
parentcbd402d8cb6aa699ffde83a1b5b3c2f4fc51baaf (diff)
parent77bf649fb4482c86ac1fd9b3233f062b53226007 (diff)
downloadpowder-981f6984c2c0f87d54a9c90f4518c69c9ef02ae0.zip
powder-981f6984c2c0f87d54a9c90f4518c69c9ef02ae0.tar.gz
Merge branch 'HEAD' of git@github.com:FacialTurd/The-Powder-Toy.git
Diffstat (limited to 'src/gui/game/PropertyTool.cpp')
-rw-r--r--src/gui/game/PropertyTool.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/game/PropertyTool.cpp b/src/gui/game/PropertyTool.cpp
index 05726d3..90e70b3 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 || !sim->elements[tempInt].Enabled))
+ {
+ 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,
@@ -232,4 +238,4 @@ void PropertyWindow::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl
void PropertyTool::Click(Simulation * sim, Brush * brush, ui::Point position)
{
new PropertyWindow(this, sim, position);
-} \ No newline at end of file
+}