From f9718af18bdceb3c75007127daf37c537e29c230 Mon Sep 17 00:00:00 2001 From: Rubberduckycooly Date: Sun, 9 May 2021 18:44:00 +1000 Subject: [PATCH] there was a critical bug. --- RSDKv4/Script.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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;