From 4a00450e591e1bb2e8a2bc913ce1e1acfaef08b6 Mon Sep 17 00:00:00 2001 From: wolf109909 <84360921+wolf109909@users.noreply.github.com> Date: Mon, 28 Nov 2022 05:50:26 +0800 Subject: [PATCH] Fix script compile errors not being flushed to log file (#342) Otherwise application will crash before finishing to write to log file. --- NorthstarDLL/squirrel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NorthstarDLL/squirrel.cpp b/NorthstarDLL/squirrel.cpp index cd8b437c..06a88ba3 100644 --- a/NorthstarDLL/squirrel.cpp +++ b/NorthstarDLL/squirrel.cpp @@ -359,7 +359,11 @@ void __fastcall ScriptCompileErrorHook(HSquirrelVM* sqvm, const char* error, con { // kill dedicated server if we hit this if (IsDedicatedServer()) + { + // flush the logger before we abort so debug things get saved to log file + logger->flush(); abort(); + } else { R2::Cbuf_AddText(