Fix script compile errors not being flushed to log file (#342)

Otherwise application will crash before finishing to write to log file.
This commit is contained in:
wolf109909 2022-11-28 05:50:26 +08:00 committed by GitHub
parent 9ed73b5b98
commit 4a00450e59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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(