aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/squirrel/squirrel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/squirrel/squirrel.cpp')
-rw-r--r--NorthstarDLL/squirrel/squirrel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/NorthstarDLL/squirrel/squirrel.cpp b/NorthstarDLL/squirrel/squirrel.cpp
index eb4b6bed..5e968daa 100644
--- a/NorthstarDLL/squirrel/squirrel.cpp
+++ b/NorthstarDLL/squirrel/squirrel.cpp
@@ -317,11 +317,11 @@ template <ScriptContext context> CSquirrelVM* __fastcall CreateNewVMHook(void* a
return sqvm;
}
-template <ScriptContext context> void (*__fastcall DestroyVM)(void* a1, HSquirrelVM* sqvm);
-template <ScriptContext context> void __fastcall DestroyVMHook(void* a1, HSquirrelVM* sqvm)
+template <ScriptContext context> void (*__fastcall DestroyVM)(void* a1, CSquirrelVM* sqvm);
+template <ScriptContext context> 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<ScriptContext::UI>->VMDestroyed();
@@ -329,7 +329,7 @@ template <ScriptContext context> void __fastcall DestroyVMHook(void* a1, HSquirr
}
else
{
- g_pSquirrel<context>->m_pSQVM = nullptr; // Fixes a race-like bug
+ g_pSquirrel<context>->VMDestroyed();
DestroyVM<context>(a1, sqvm);
}