prevent setting invalid element numbers in the old console
This commit is contained in:
parent
2140beb9cc
commit
e91a7f1ec4
@ -303,7 +303,7 @@ AnyType TPTScriptInterface::tptS_set(std::deque<std::string> * words)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
throw GeneralException("Invalid value for assignment");
|
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");
|
throw GeneralException("Invalid element");
|
||||||
|
|
||||||
if(selector.GetType() == TypePoint || selector.GetType() == TypeNumber)
|
if(selector.GetType() == TypePoint || selector.GetType() == TypeNumber)
|
||||||
|
Loading…
Reference in New Issue
Block a user