diff options
-rw-r--r-- | NorthstarDLL/squirrel/squirrel.cpp | 4 | ||||
-rw-r--r-- | NorthstarDLL/squirrel/squirreldatatypes.h | 16 |
2 files changed, 13 insertions, 7 deletions
diff --git a/NorthstarDLL/squirrel/squirrel.cpp b/NorthstarDLL/squirrel/squirrel.cpp index 5e968daa..82ec9f46 100644 --- a/NorthstarDLL/squirrel/squirrel.cpp +++ b/NorthstarDLL/squirrel/squirrel.cpp @@ -268,8 +268,7 @@ template <ScriptContext context> void SquirrelManager<context>::AddFuncOverride( // hooks bool IsUIVM(ScriptContext context, HSquirrelVM* pSqvm) { - return context != ScriptContext::SERVER && g_pSquirrel<ScriptContext::UI>->m_pSQVM && - g_pSquirrel<ScriptContext::UI>->m_pSQVM->sqvm == pSqvm; + return ScriptContext(pSqvm->sharedState->cSquirrelVM->vmContext) == ScriptContext::UI; } template <ScriptContext context> void* (*__fastcall sq_compiler_create)(HSquirrelVM* sqvm, void* a2, void* a3, SQBool bShouldThrowError); @@ -361,6 +360,7 @@ void __fastcall ScriptCompileErrorHook(HSquirrelVM* sqvm, const char* error, con // kill dedicated server if we hit this if (IsDedicatedServer()) { + logger->error("Exiting dedicated server, compile error is fatal"); // flush the logger before we exit so debug things get saved to log file logger->flush(); exit(EXIT_FAILURE); diff --git a/NorthstarDLL/squirrel/squirreldatatypes.h b/NorthstarDLL/squirrel/squirreldatatypes.h index e9f88d08..021edcde 100644 --- a/NorthstarDLL/squirrel/squirreldatatypes.h +++ b/NorthstarDLL/squirrel/squirreldatatypes.h @@ -19,6 +19,7 @@ struct SQNativeClosure; struct SQArray; struct tableNode; struct SQUserData; +struct CSquirrelVM; typedef void (*releasehookType)(void* val, int size); @@ -395,7 +396,7 @@ struct SQSharedState SQString* _SpinOffStringValue; SQObjectType _SpinOffDelayedStringType; SQString* _SpinOffDelayedStringValue; - unsigned char gap_43E8[8]; + CSquirrelVM* cSquirrelVM; bool enableDebugInfo; // functionality stripped unsigned char gap_43F1[23]; }; @@ -470,11 +471,16 @@ struct SQCompiler /* 155 */ struct CSquirrelVM { - unsigned char gap_0[8]; + BYTE gap_0[8]; HSquirrelVM* sqvm; - unsigned char gap_10[44]; - int loadEnumFromFileMaybe; - unsigned char gap_40[200]; + BYTE gap_10[8]; + SQObject unknownObject_18; + __int64 unknown_28; + BYTE gap_30[12]; + __int32 vmContext; + BYTE gap_40[648]; + char* (*formatString)(__int64 a1, const char* format, ...); + BYTE gap_2D0[24]; }; struct SQUserData |