From 21bfb9753f1bbbaa24def53f1ed094427799679a Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 30 Oct 2022 13:29:27 +0000 Subject: [PATCH] Only read/write luavars from demos if Lua state has been initialised. --- src/g_game.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 2faf1cf51..cc5a1044d 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -6734,7 +6734,7 @@ void G_BeginRecording(void) demoflags |= DF_ENCORE; #ifdef HAVE_BLUA - if (!modeattacking) // Ghosts don't read luavars, and you shouldn't ever need to save Lua in replays, you doof! + if (!modeattacking && gL) // Ghosts don't read luavars, and you shouldn't ever need to save Lua in replays, you doof! // SERIOUSLY THOUGH WHY WOULD YOU LOAD HOSTMOD AND RECORD A GHOST WITH IT !???? demoflags |= DF_LUAVARS; #endif @@ -6843,7 +6843,7 @@ void G_BeginRecording(void) #ifdef HAVE_BLUA // player lua vars, always saved even if empty... Unless it's record attack. - if (!modeattacking) + if (demoflags & DF_LUAVARS) LUA_ArchiveDemo(); #endif