diff --git a/src/editor/f_main.pas b/src/editor/f_main.pas
index 00802bbdd83bed88d058252f8107dc09979495bd..225daecbb528255b4ad1c689dcdb14b2e59d705d 100644 (file)
--- a/src/editor/f_main.pas
+++ b/src/editor/f_main.pas
procedure TMainForm.miTestMapClick(Sender: TObject);
var
procedure TMainForm.miTestMapClick(Sender: TObject);
var
- newWAD, oldWAD, tempMap: String;
+ newWAD, oldWAD, tempMap, ext: String;
args: SSArray;
opt: LongWord;
time, i: Integer;
args: SSArray;
opt: LongWord;
time, i: Integer;
// Сохраняем временную карту:
time := 0;
repeat
// Сохраняем временную карту:
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);
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)
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);
end;
tempMap := newWAD + ':\' + TEST_MAP_NAME;
SaveMap(tempMap);