mirror of
https://github.com/bearstonem/openmohaa-vr.git
synced 2026-10-18 11:00:23 +02:00
fix(script): retrieve type name before clearing and printing valid type in array evaluation
This commit is contained in:
1 file changed
+4
-1
@@ -957,6 +957,7 @@ void ScriptVariable::evalArrayAt(ScriptVariable& var)
|
||||
unsigned int index;
|
||||
str string;
|
||||
ScriptVariable *array;
|
||||
const char *typeName;
|
||||
|
||||
switch (GetType()) {
|
||||
case VARIABLE_VECTOR:
|
||||
@@ -1036,8 +1037,10 @@ void ScriptVariable::evalArrayAt(ScriptVariable& var)
|
||||
break;
|
||||
|
||||
default:
|
||||
typeName = GetTypeName();
|
||||
|
||||
Clear();
|
||||
throw ScriptException("[] applied to invalid type '%s'", GetTypeName());
|
||||
throw ScriptException("[] applied to invalid type '%s'", typeName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user