From b92759eca36cc1d92ed4ae999c7da6210ccec15f Mon Sep 17 00:00:00 2001 From: drfrag Date: Tue, 17 Nov 2020 21:04:23 +0100 Subject: [PATCH] - Fixed config file being overriden when it's blocked by another application. --- src/configfile.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/configfile.cpp b/src/configfile.cpp index 2dc016e9e..ddf6d3937 100644 --- a/src/configfile.cpp +++ b/src/configfile.cpp @@ -41,6 +41,9 @@ #include "files.h" #include "m_random.h" +#include "filesystem.h" +#include "doomerrors.h" + #define READBUFFERSIZE 256 static FRandom pr_endtag; @@ -605,10 +608,13 @@ void FConfigFile::LoadConfigFile () FileReader file; bool succ; - FileExisted = false; + if (!FileExists(PathName)) + FileExisted = false; + if (!file.OpenFile (PathName)) { - return; + if (!FileExisted) return; + else I_Error ("Could not Open Config file.\n"); } succ = ReadConfig (&file);