From eb369b24c3988699eac184717a067c2cc8e0b4b5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 5 Nov 2022 23:24:45 +0100 Subject: [PATCH] - fixed FileExists check for -loadgame. This was done before the current savegame path was known so it always errored out. --- src/d_main.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 7fb23e8195..f2ab56e673 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -3430,6 +3430,10 @@ static int D_InitGame(const FIWADInfo* iwad_info, TArray& allwads, TArr if (v) { FString file = G_BuildSaveName(v); + if (!FileExists(file)) + { + I_FatalError("Cannot find savegame %s", file.GetChars()); + } G_LoadGame(file); } @@ -3607,17 +3611,6 @@ static int D_DoomMain_Internal (void) // Now that we have the IWADINFO, initialize the autoload ini sections. GameConfig->DoAutoloadSetup(iwad_man); - // Prevent the game from starting if the savegame passed to -loadgame is invalid - v = Args->CheckValue("-loadgame"); - if (v) - { - FString file = G_BuildSaveName(v); - if (!FileExists(file)) - { - I_FatalError("Cannot find savegame %s", file.GetChars()); - } - } - // reinit from here do