From 96f243d5192251aeb0ffdb10cef8f5340e3c0719 Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Thu, 3 Nov 2022 02:23:00 +0100 Subject: [PATCH] Light squirrel code cleanup Renamed 'Script_GetContextObject' to 'Script_GetScriptHandle'. --- r5dev/squirrel/sqscript.cpp | 12 ++++++------ r5dev/squirrel/sqscript.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/r5dev/squirrel/sqscript.cpp b/r5dev/squirrel/sqscript.cpp index 5def95a8..5105d4f0 100644 --- a/r5dev/squirrel/sqscript.cpp +++ b/r5dev/squirrel/sqscript.cpp @@ -164,7 +164,7 @@ SQRESULT Script_InitializeCLGlobalStructs(HSQUIRRELVM v, SQCONTEXT context) void Script_InitializeSVGlobalStructs(HSQUIRRELVM v) { v_Script_InitializeSVGlobalStructs(v); - Script_RegisterServerFunctions(Script_GetContextObject(SQCONTEXT::SERVER)); + Script_RegisterServerFunctions(Script_GetScriptHandle(SQCONTEXT::SERVER)); } //--------------------------------------------------------------------------------- @@ -175,7 +175,7 @@ SQBool Script_CreateServerVM() { SQBool results = v_Script_CreateServerVM(); if (results) - DevMsg(eDLL_T::SERVER, "Created SERVER VM: '%p'\n", Script_GetContextObject(SQCONTEXT::SERVER)); + DevMsg(eDLL_T::SERVER, "Created SERVER VM: '0x%p'\n", Script_GetScriptHandle(SQCONTEXT::SERVER)); else Error(eDLL_T::SERVER, EXIT_FAILURE, "Failed to create SERVER VM\n"); return results; @@ -192,7 +192,7 @@ SQBool Script_CreateClientVM(CHLClient* hlclient) { SQBool results = v_Script_CreateClientVM(hlclient); if (results) - DevMsg(eDLL_T::CLIENT, "Created CLIENT VM: '%p'\n", Script_GetContextObject(SQCONTEXT::CLIENT)); + DevMsg(eDLL_T::CLIENT, "Created CLIENT VM: '0x%p'\n", Script_GetScriptHandle(SQCONTEXT::CLIENT)); else Error(eDLL_T::CLIENT, EXIT_FAILURE, "Failed to create CLIENT VM\n"); return results; @@ -206,7 +206,7 @@ SQBool Script_CreateUIVM() { SQBool results = v_Script_CreateUIVM(); if (results) - DevMsg(eDLL_T::UI, "Created UI VM: '%p'\n", Script_GetContextObject(SQCONTEXT::UI)); + DevMsg(eDLL_T::UI, "Created UI VM: '0x%p'\n", Script_GetScriptHandle(SQCONTEXT::UI)); else Error(eDLL_T::UI, EXIT_FAILURE, "Failed to create UI VM\n"); return results; @@ -218,7 +218,7 @@ SQBool Script_CreateUIVM() // Input : context - // Output : SQVM* //--------------------------------------------------------------------------------- -CSquirrelVM* Script_GetContextObject(const SQCONTEXT context) +CSquirrelVM* Script_GetScriptHandle(const SQCONTEXT context) { switch (context) { @@ -300,7 +300,7 @@ void Script_Execute(const SQChar* code, const SQCONTEXT context) return; // Only run in main thread. } - CSquirrelVM* s = Script_GetContextObject(context); + CSquirrelVM* s = Script_GetScriptHandle(context); if (!s) { Error(eDLL_T::ENGINE, NO_ERROR, "Attempted to run %s script with no handle to VM\n", SQVM_GetContextName(context)); diff --git a/r5dev/squirrel/sqscript.h b/r5dev/squirrel/sqscript.h index 773d0637..83228a70 100644 --- a/r5dev/squirrel/sqscript.h +++ b/r5dev/squirrel/sqscript.h @@ -136,7 +136,7 @@ SQBool Script_CreateServerVM(); SQBool Script_CreateClientVM(CHLClient* hlclient); #endif // !DEDICATED SQBool Script_CreateUIVM(); -CSquirrelVM* Script_GetContextObject(const SQCONTEXT context); +CSquirrelVM* Script_GetScriptHandle(const SQCONTEXT context); SQInteger Script_LoadRson(const SQChar* rsonfile); SQBool Script_LoadScript(HSQUIRRELVM v, const SQChar* path, const SQChar* name, SQInteger flags);