From 955bce518d1ce6de18133b8ee19a6436aef174cd Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Fri, 8 Apr 2016 04:12:37 +0300 Subject: [PATCH] also, .pk3 seems to work now --- src/game/g_game.pas | 14 +++++++------- src/game/g_map.pas | 2 +- src/shared/WADEDITOR.pas | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 408191b..9cca04c 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -5180,7 +5180,7 @@ begin Exit; end; // Èãðà åù¸ íå çàïóùåíà, ñíà÷àëà íàì íàäî çàãðóçèòü êàêîé-òî WAD - if Pos('.wad', LowerCase(P[1])) = 0 then + if (Pos('.wad', LowerCase(P[1])) = 0) and (Pos('.pk3', LowerCase(P[1])) = 0) then P[1] := P[1] + '.wad'; if FileExists(MapsDir + P[1]) then @@ -5236,7 +5236,7 @@ begin Exit; prt := StrToIntDef(P[2], 25666); - if Pos('.wad', LowerCase(P[3])) = 0 then + if (Pos('.wad', LowerCase(P[3])) = 0) and (Pos('.pk3', LowerCase(P[3])) = 0) then P[3] := P[3] + '.wad'; if FileExists(MapsDir + P[3]) then @@ -5308,7 +5308,7 @@ begin begin g_Console_Add(Format(_lc[I_MSG_NO_MAP], [s])); // Òàêîé êàðòû íåò, èùåì WAD ôàéë - if Pos('.wad', LowerCase(P[1])) = 0 then + if (Pos('.wad', LowerCase(P[1])) = 0) and (Pos('.pk3', LowerCase(P[1])) = 0) then P[1] := P[1] + '.wad'; if FileExists(MapsDir + P[1]) then @@ -5340,7 +5340,7 @@ begin end else begin // Óêàçàíî äâà ïàðàìåòðà, çíà÷èò ïåðâûé - WAD ôàéë, à âòîðîé - êàðòà - if Pos('.wad', LowerCase(P[1])) = 0 then + if (Pos('.wad', LowerCase(P[1])) = 0) and (Pos('.pk3', LowerCase(P[1])) = 0) then P[1] := P[1] + '.wad'; if FileExists(MapsDir + P[1]) then @@ -5401,7 +5401,7 @@ begin begin g_Console_Add(Format(_lc[I_MSG_NO_MAP], [s])); // Òàêîé êàðòû íåò, èùåì WAD ôàéë - if Pos('.wad', LowerCase(P[1])) = 0 then + if (Pos('.wad', LowerCase(P[1])) = 0) and (Pos('.pk3', LowerCase(P[1])) = 0) then P[1] := P[1] + '.wad'; if FileExists(MapsDir + P[1]) then @@ -5428,7 +5428,7 @@ begin end else begin // Óêàçàíî äâà ïàðàìåòðà, çíà÷èò ïåðâûé - WAD ôàéë, à âòîðîé - êàðòà - if Pos('.wad', LowerCase(P[1])) = 0 then + if (Pos('.wad', LowerCase(P[1])) = 0) and (Pos('.pk3', LowerCase(P[1])) = 0) then P[1] := P[1] + '.wad'; if FileExists(MapsDir + P[1]) then @@ -6257,7 +6257,7 @@ begin // Start map when game loads: map := LowerCase(Find_Param_Value(pars, '-map')); - if (map <> '') and (Pos('.wad:\', map) > 0) then + if (map <> '') and ((Pos('.wad:\', map) > 0) or (Pos('.pk3:\', map) > 0)) then begin // Game mode: s := Find_Param_Value(pars, '-gm'); diff --git a/src/game/g_map.pas b/src/game/g_map.pas index 820dcf9..358b16d 100644 --- a/src/game/g_map.pas +++ b/src/game/g_map.pas @@ -1325,7 +1325,7 @@ begin g_ProcessResourceStr(Res, FileName, SectionName, ResName); - if Pos('.wad', LowerCase(FileName)) = 0 then FileName := FileName+'.wad'; + if (Pos('.wad', LowerCase(FileName)) = 0) and (Pos('.pk3', LowerCase(FileName)) = 0) then FileName := FileName+'.wad'; WAD := TWADEditor_1.Create; if not WAD.ReadFile(FileName) then diff --git a/src/shared/WADEDITOR.pas b/src/shared/WADEDITOR.pas index 4c3e9ae..0c3357b 100644 --- a/src/shared/WADEDITOR.pas +++ b/src/shared/WADEDITOR.pas @@ -224,7 +224,7 @@ begin begin rfn := Copy(rfn, 1, length(rfn)-4); if FileExists(rfn+'.pk3') then rfn := rfn+'.pk3' - else if FileExists(rfn+'.zip') then rfn := rfn+'.zip' + //else if FileExists(rfn+'.zip') then rfn := rfn+'.zip' else rfn := FileName; {.$IFDEF SFS_DWFAD_DEBUG} if gSFSDebug then -- 2.29.2