diff --git a/src/gui/game/PropertyTool.cpp b/src/gui/game/PropertyTool.cpp index aff535e39..6c9bf264b 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,