small fixes

This commit is contained in:
spherallic 2023-02-02 12:20:21 +01:00
parent 8f74ff048e
commit 5b1ceb8941

View file

@ -932,7 +932,7 @@ namespace CodeImp.DoomBuilder
if((purpose != SavePurpose.IntoFile) && (newfilepathname != filepathname))
{
// Kill target file
if(fileexists) File.Delete(newfilepathname);
if(File.Exists(newfilepathname)) File.Delete(newfilepathname);
// Kill .dbs settings file
settingsfile = newfilepathname.Substring(0, newfilepathname.Length - 4) + ".dbs";
@ -947,7 +947,7 @@ namespace CodeImp.DoomBuilder
}
// If the target file exists, we need to rebuild it
if(fileexists)
if(File.Exists(newfilepathname))
{
// Move the target file aside
origwadfile = newfilepathname + ".temp";
@ -992,7 +992,7 @@ namespace CodeImp.DoomBuilder
if(!string.IsNullOrEmpty(origwadfile) && File.Exists(origwadfile))
{
//mxd. Clean-up
if(fileexists)
if(File.Exists(newfilepathname))
{
//mxd. We MAY've just deleted the map from the target file. Let's pretend this never happened
if(targetwad != null) targetwad.Dispose();