diff --git a/src/scripting/codegeneration/codegen.cpp b/src/scripting/codegeneration/codegen.cpp index db6355f84..f19e8901f 100644 --- a/src/scripting/codegeneration/codegen.cpp +++ b/src/scripting/codegeneration/codegen.cpp @@ -7886,7 +7886,7 @@ FxExpression *FxRuntimeStateIndex::Resolve(FCompileContext &ctx) delete this; return nullptr; } - else if (Index->isConstant() && static_cast(Index)->GetValue() < 0) + else if (Index->isConstant() && static_cast(Index)->GetValue().GetInt() < 0) { ScriptPosition.Message(MSG_ERROR, "State index must be positive"); delete this;