From 4e53df8bca5e0dad98c6bdac9b1b5d9acf479d1d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 26 Jan 2014 14:32:44 +0100 Subject: [PATCH] - fixed: The 'load' command in GAMEINFO only worked if the filename contained a slash. --- src/d_main.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 5dd186cd0b..6c938ef53f 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1807,19 +1807,23 @@ static FString ParseGameInfo(TArray &pwads, const char *fn, const char // Try looking for the wad in the same directory as the .wad // before looking for it in the current directory. + FString checkpath; if (lastSlash != NULL) { - FString checkpath(fn, (lastSlash - fn) + 1); + checkpath = FString(fn, (lastSlash - fn) + 1); checkpath += sc.String; - - if (!FileExists (checkpath)) - { - pos += D_AddFile(pwads, sc.String, true, pos); - } - else - { - pos += D_AddFile(pwads, checkpath, true, pos); - } + } + else + { + checkpath = sc.String; + } + if (!FileExists(checkpath)) + { + pos += D_AddFile(pwads, sc.String, true, pos); + } + else + { + pos += D_AddFile(pwads, checkpath, true, pos); } } while (sc.CheckToken(','));