mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-21 15:41:35 +02:00
prevent setting invalid element numbers in the old console
This commit is contained in:
@@ -303,7 +303,7 @@ AnyType TPTScriptInterface::tptS_set(std::deque<std::string> * words)
|
||||
}
|
||||
else
|
||||
throw GeneralException("Invalid value for assignment");
|
||||
if (property.Value() == "type" && (newValue < 0 || newValue >= PT_NUM))
|
||||
if (property.Value() == "type" && (newValue < 0 || newValue >= PT_NUM || !sim->elements[newValue].Enabled))
|
||||
throw GeneralException("Invalid element");
|
||||
|
||||
if(selector.GetType() == TypePoint || selector.GetType() == TypeNumber)
|
||||
|
Reference in New Issue
Block a user