From e91a7f1ec4e9c3c2c234bf73428495a96d04fb1f Mon Sep 17 00:00:00 2001 From: jacob1 Date: Fri, 29 Aug 2014 18:11:00 -0400 Subject: [PATCH] prevent setting invalid element numbers in the old console --- src/lua/TPTScriptInterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua/TPTScriptInterface.cpp b/src/lua/TPTScriptInterface.cpp index 96ba11d04..edcca0f34 100644 --- a/src/lua/TPTScriptInterface.cpp +++ b/src/lua/TPTScriptInterface.cpp @@ -303,7 +303,7 @@ AnyType TPTScriptInterface::tptS_set(std::deque * 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)