fix bug where you could set invalid types with PROP
This commit is contained in:
parent
51f27bfad7
commit
135bf44347
@ -139,6 +139,11 @@ void PropertyWindow::SetProperty()
|
|||||||
buffer.exceptions(std::stringstream::failbit | std::stringstream::badbit);
|
buffer.exceptions(std::stringstream::failbit | std::stringstream::badbit);
|
||||||
buffer >> tempInt;
|
buffer >> tempInt;
|
||||||
}
|
}
|
||||||
|
if (property->GetOption().first == "type" && (tempInt < 0 || tempInt >= PT_NUM))
|
||||||
|
{
|
||||||
|
new ErrorMessage("Could not set property", "Invalid Particle Type");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -193,6 +198,7 @@ void PropertyWindow::SetProperty()
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
new ErrorMessage("Could not set property", "Invalid property");
|
new ErrorMessage("Could not set property", "Invalid property");
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
sim->flood_prop(
|
sim->flood_prop(
|
||||||
position.X,
|
position.X,
|
||||||
|
Reference in New Issue
Block a user