From 9b0c48f9e534e9d04894d0a271c0206c2f236149 Mon Sep 17 00:00:00 2001 From: jenz Date: Mon, 10 Jun 2024 16:16:46 +0200 Subject: [PATCH] copied fix from boss --- SMJSONAPI/scripting/SMJSONAPI.sp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/SMJSONAPI/scripting/SMJSONAPI.sp b/SMJSONAPI/scripting/SMJSONAPI.sp index c2f825b0..9727bf90 100644 --- a/SMJSONAPI/scripting/SMJSONAPI.sp +++ b/SMJSONAPI/scripting/SMJSONAPI.sp @@ -195,8 +195,14 @@ static int HandleRequest(int Client, JSONObject jRequest, JSONObject jResponse) Function Fun = GetFunctionByName(INVALID_HANDLE, sAPIFunction); if(Fun == INVALID_FUNCTION) { + /* int Res = Call_StartNative(sFunction); if(!Res) + */ + int Res = 0; + #if defined Call_StartNative + Res = Call_StartNative(sFunction); + #endif { JSONObject jError = new JSONObject(); jError.SetString("error", "Invalid function specified."); @@ -385,7 +391,13 @@ static int HandleRequest(int Client, JSONObject jRequest, JSONObject jResponse) int Result; static char sException[1024]; - int Error = Call_FinishEx(Result, sException, sizeof(sException)); + #if defined Call_FinishEx + int Error = Call_FinishEx(Result, sException, sizeof(sException)); + #else + int Error = Call_Finish(Result); + #endif + + //int Error = Call_FinishEx(Result, sException, sizeof(sException)); if(Error != SP_ERROR_NONE) {