diff options
author | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-10-06 21:46:32 +0100 |
---|---|---|
committer | BobTheBob <32057864+BobTheBob9@users.noreply.github.com> | 2021-10-06 21:46:32 +0100 |
commit | 900855c0036aa9a6a6305e3f17a41a55640bdfaf (patch) | |
tree | 2f6a3c07549927b600ec3b1a8389a0062a684a53 /NorthstarDedicatedTest/squirrel.cpp | |
parent | 51df18abbc0c344b56f88e0a66b6b46d6aca375c (diff) | |
download | NorthstarLauncher-900855c0036aa9a6a6305e3f17a41a55640bdfaf.tar.gz NorthstarLauncher-900855c0036aa9a6a6305e3f17a41a55640bdfaf.zip |
add mod enabling/disabling
Diffstat (limited to 'NorthstarDedicatedTest/squirrel.cpp')
-rw-r--r-- | NorthstarDedicatedTest/squirrel.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/NorthstarDedicatedTest/squirrel.cpp b/NorthstarDedicatedTest/squirrel.cpp index 85e26c45..dfeb1805 100644 --- a/NorthstarDedicatedTest/squirrel.cpp +++ b/NorthstarDedicatedTest/squirrel.cpp @@ -81,6 +81,9 @@ sq_getintegerType ServerSq_getinteger; sq_getfloatType ClientSq_getfloat; sq_getfloatType ServerSq_getfloat; +sq_getboolType ClientSq_getbool; +sq_getboolType ServerSq_getbool; + template<Context context> void ExecuteCodeCommand(const CCommand& args); @@ -130,6 +133,7 @@ void InitialiseClientSquirrel(HMODULE baseAddress) ClientSq_getstring = (sq_getstringType)((char*)baseAddress + 0x60C0); ClientSq_getinteger = (sq_getintegerType)((char*)baseAddress + 0x60E0); ClientSq_getfloat = (sq_getfloatType)((char*)baseAddress + 0x6100); + ClientSq_getbool = (sq_getboolType)((char*)baseAddress + 0x6130); ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x26130, &CreateNewVMHook<CLIENT>, reinterpret_cast<LPVOID*>(&ClientCreateNewVM)); // client createnewvm function ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x26E70, &DestroyVMHook<CLIENT>, reinterpret_cast<LPVOID*>(&ClientDestroyVM)); // client destroyvm function @@ -140,7 +144,6 @@ void InitialiseClientSquirrel(HMODULE baseAddress) void InitialiseServerSquirrel(HMODULE baseAddress) { g_ServerSquirrelManager = new SquirrelManager<SERVER>(); - g_ServerSquirrelManager->AddFuncRegistration("void", "SavePdataForEntityIndex", "int i", "idk", NSTestFunc); HookEnabler hook; @@ -160,6 +163,7 @@ void InitialiseServerSquirrel(HMODULE baseAddress) ServerSq_getstring = (sq_getstringType)((char*)baseAddress + 0x60A0); ServerSq_getinteger = (sq_getintegerType)((char*)baseAddress + 0x60C0); ServerSq_getfloat = (sq_getfloatType)((char*)baseAddress + 0x60E0); + ServerSq_getbool = (sq_getboolType)((char*)baseAddress + 0x6110); ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x1FE90, &SQPrintHook<SERVER>, reinterpret_cast<LPVOID*>(&ServerSQPrint)); // server print function ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0x260E0, &CreateNewVMHook<SERVER>, reinterpret_cast<LPVOID*>(&ServerCreateNewVM)); // server createnewvm function @@ -280,6 +284,9 @@ template<Context context> char CallScriptInitCallbackHook(void* sqvm, const char { for (Mod* mod : g_ModManager->m_loadedMods) { + if (!mod->Enabled) + continue; + for (ModScript* script : mod->Scripts) { for (ModScriptCallback* modCallback : script->Callbacks) @@ -304,6 +311,9 @@ template<Context context> char CallScriptInitCallbackHook(void* sqvm, const char { for (Mod* mod : g_ModManager->m_loadedMods) { + if (!mod->Enabled) + continue; + for (ModScript* script : mod->Scripts) { for (ModScriptCallback* modCallback : script->Callbacks) @@ -329,6 +339,9 @@ template<Context context> char CallScriptInitCallbackHook(void* sqvm, const char { for (Mod* mod : g_ModManager->m_loadedMods) { + if (!mod->Enabled) + continue; + for (ModScript* script : mod->Scripts) { for (ModScriptCallback* modCallback : script->Callbacks) @@ -353,6 +366,9 @@ template<Context context> char CallScriptInitCallbackHook(void* sqvm, const char { for (Mod* mod : g_ModManager->m_loadedMods) { + if (!mod->Enabled) + continue; + for (ModScript* script : mod->Scripts) { for (ModScriptCallback* modCallback : script->Callbacks) |