From: DeaDDooMER Date: Sat, 7 Dec 2019 17:22:19 +0000 (+0300) Subject: save temp wad with ext from opened wad X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-editor.git;a=commitdiff_plain;h=fd99178e87f17fe1416ef9c73278e8a877f8f925 save temp wad with ext from opened wad --- 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);