diff options
author | Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> | 2023-01-04 21:12:53 +0000 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2023-01-04 23:43:09 +0100 |
commit | 401b17300d167b961e5a86a5dbae3aa9e2bedbb4 (patch) | |
tree | 4fe455aaea92aff23eebd82063be85c6173365e6 /NorthstarDLL/squirrel/squirrel.cpp | |
parent | 2c4a25a0f2b28ba278a46c1755637374f90e9b35 (diff) | |
download | NorthstarLauncher-401b17300d167b961e5a86a5dbae3aa9e2bedbb4.tar.gz NorthstarLauncher-401b17300d167b961e5a86a5dbae3aa9e2bedbb4.zip |
Improve response to UI VM compile errors (#388)v1.11.2-rc3v1.11.2
* log reaction to script compile errors
* move log line to make a bit more sense
* change log message and show console on non-fatal ui compile error
* improve SQSharedState struct and CSquirrelVM struct
Co-Authored-By: Maya <11448698+RoyalBlue1@users.noreply.github.com>
* Improve IsUIVM
Co-Authored-By: Maya <11448698+RoyalBlue1@users.noreply.github.com>
* Remove now-unnecessary showing of console
* remove extra logging
Co-authored-by: Maya <11448698+RoyalBlue1@users.noreply.github.com>
Diffstat (limited to 'NorthstarDLL/squirrel/squirrel.cpp')
-rw-r--r-- | NorthstarDLL/squirrel/squirrel.cpp | 4 |
1 files changed, 2 insertions, 2 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); |