From fd99178e87f17fe1416ef9c73278e8a877f8f925 Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Sat, 7 Dec 2019 20:22:19 +0300 Subject: [PATCH] save temp wad with ext from opened wad --- src/editor/f_main.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas index 00802bb..225daec 100644 --- a/src/editor/f_main.pas +++ b/src/editor/f_main.pas @@ -6732,7 +6732,7 @@ end; procedure TMainForm.miTestMapClick(Sender: TObject); var - newWAD, oldWAD, tempMap: String; + newWAD, oldWAD, tempMap, ext: String; args: SSArray; opt: LongWord; time, i: Integer; @@ -6742,14 +6742,19 @@ begin // Сохраняем временную карту: time := 0; repeat - newWAD := ExtractFilePath(TestD2dExe) + Format('maps/temp%.4d.wad', [time]); + newWAD := ExtractFilePath(TestD2dExe) + Format('maps/temp%.4d', [time]); Inc(time); until not FileExists(newWAD); if OpenedMap <> '' then begin oldWad := g_ExtractWadName(OpenedMap); + newWad := newWad + ExtractFileExt(oldWad); if CopyFile(oldWad, newWad) = false then e_WriteLog('MapTest: unable to copy [' + oldWad + '] to [' + newWad + ']', MSG_WARNING) + end + else + begin + newWad := newWad + '.wad' end; tempMap := newWAD + ':\' + TEST_MAP_NAME; SaveMap(tempMap); -- 2.29.2