diff --git a/NorthstarDLL/squirrel/squirrel.cpp b/NorthstarDLL/squirrel/squirrel.cpp index eb4b6bed8..5e968daa4 100644 --- a/NorthstarDLL/squirrel/squirrel.cpp +++ b/NorthstarDLL/squirrel/squirrel.cpp @@ -317,11 +317,11 @@ template CSquirrelVM* __fastcall CreateNewVMHook(void* a return sqvm; } -template void (*__fastcall DestroyVM)(void* a1, HSquirrelVM* sqvm); -template void __fastcall DestroyVMHook(void* a1, HSquirrelVM* sqvm) +template void (*__fastcall DestroyVM)(void* a1, CSquirrelVM* sqvm); +template void __fastcall DestroyVMHook(void* a1, CSquirrelVM* sqvm) { ScriptContext realContext = context; // ui and client use the same function so we use this for prints - if (IsUIVM(context, sqvm)) + if (IsUIVM(context, sqvm->sqvm)) { realContext = ScriptContext::UI; g_pSquirrel->VMDestroyed(); @@ -329,7 +329,7 @@ template void __fastcall DestroyVMHook(void* a1, HSquirr } else { - g_pSquirrel->m_pSQVM = nullptr; // Fixes a race-like bug + g_pSquirrel->VMDestroyed(); DestroyVM(a1, sqvm); }