From 9ed73b5b989ce079a7349f7bdda88689fd5ac1c4 Mon Sep 17 00:00:00 2001 From: Emma Miler Date: Sun, 27 Nov 2022 21:27:42 +0100 Subject: Pre-init squirrel managers (#348) * init * Format --- NorthstarDLL/squirrel.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'NorthstarDLL/squirrel.cpp') diff --git a/NorthstarDLL/squirrel.cpp b/NorthstarDLL/squirrel.cpp index 673e2098..cd8b437c 100644 --- a/NorthstarDLL/squirrel.cpp +++ b/NorthstarDLL/squirrel.cpp @@ -550,9 +550,6 @@ ON_DLL_LOAD_RELIESON("client.dll", ClientSquirrel, ConCommand, (CModule module)) { AUTOHOOK_DISPATCH_MODULE(client.dll) - g_pSquirrel = new SquirrelManager; - g_pSquirrel = new SquirrelManager; - g_pSquirrel->__sq_defconst = module.Offset(0x12120).As(); g_pSquirrel->__sq_defconst = g_pSquirrel->__sq_defconst; @@ -663,8 +660,6 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerSquirrel, ConCommand, (CModule module)) { AUTOHOOK_DISPATCH_MODULE(server.dll) - g_pSquirrel = new SquirrelManager; - g_pSquirrel->__sq_defconst = module.Offset(0x1F550).As(); g_pSquirrel->__sq_compilebuffer = module.Offset(0x3110).As(); @@ -732,3 +727,10 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerSquirrel, ConCommand, (CModule module)) StubUnsafeSQFuncs(); } + +void InitialiseSquirrelManagers() +{ + g_pSquirrel = new SquirrelManager; + g_pSquirrel = new SquirrelManager; + g_pSquirrel = new SquirrelManager; +} -- cgit v1.2.3