diff --git a/RSDKv4/Script.cpp b/RSDKv4/Script.cpp index c287fbfc9..8b6018181 100644 --- a/RSDKv4/Script.cpp +++ b/RSDKv4/Script.cpp @@ -4402,11 +4402,11 @@ void ProcessScript(int scriptCodePtr, int jumpTablePtr, byte scriptEvent) } case FUNC_CALLNATIVEFUNCTION: opcodeSize = 0; - if (scriptEng.operands[0] <= 0xF) + if (scriptEng.operands[0] >= 0 && scriptEng.operands[0] <= 0xF) nativeFunction[scriptEng.operands[0]](0x00, NULL); break; case FUNC_CALLNATIVEFUNCTION2: - if (scriptEng.operands[0] <= 0xF) { + if (scriptEng.operands[0] >= 0 && scriptEng.operands[0] <= 0xF) { if (StrLength(scriptText)) { nativeFunction[scriptEng.operands[0]](scriptEng.operands[2], scriptText); } @@ -4417,7 +4417,7 @@ void ProcessScript(int scriptCodePtr, int jumpTablePtr, byte scriptEvent) } break; case FUNC_CALLNATIVEFUNCTION4: - if (scriptEng.operands[0] <= 0xF) + if (scriptEng.operands[0] >= 0 && scriptEng.operands[0] <= 0xF) nativeFunction[scriptEng.operands[0]](scriptEng.operands[1], reinterpret_cast(static_cast(scriptEng.operands[2]))); break;