From: fgsfds Date: Fri, 12 Apr 2019 14:26:28 +0000 (+0300) Subject: `map` command now looks for all pack extensions X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=11f1db221de3d7c80641b87194a920e54850b713;p=d2df-sdl.git `map` command now looks for all pack extensions --- diff --git a/src/game/g_game.pas b/src/game/g_game.pas index 2646534..7c413aa 100644 --- a/src/game/g_game.pas +++ b/src/game/g_game.pas @@ -6580,12 +6580,13 @@ begin end else begin // Òàêîé êàðòû íåò, èùåì WAD ôàéë - P[1] := addWadExtension(P[1]); - g_Console_Add(Format(_lc[I_MSG_NO_MAP_FALLBACK], [s, P[1]])); - if FileExists(MapsDir + P[1]) then + pw := findDiskWad(MapsDir + P[1]); + g_Console_Add(Format(_lc[I_MSG_NO_MAP_FALLBACK], [s, 'WAD ' + P[1]])); + if FileExists(pw) then begin // Ïàðàìåòðà êàðòû íåò, ïîýòîìó ñòàâèì ïåðâóþ èç ôàéëà SetLength(P, 3); + P[1] := ExtractRelativePath(MapsDir, pw); P[2] := g_Game_GetFirstMap(MapsDir + P[1]); s := P[1] + ':\' + P[2]; diff --git a/src/shared/utils.pas b/src/shared/utils.pas index 1600605..2117227 100644 --- a/src/shared/utils.pas +++ b/src/shared/utils.pas @@ -1129,7 +1129,7 @@ begin end; -const fileExtensions: array [0..6] of AnsiString = ('.wad', '.dfzip', '.dfwad', '.pk3', '.pak', '.zip', '.dfz'); +const fileExtensions: array [0..6] of AnsiString = ('.dfz', '.wad', '.dfwad', '.pk3', '.pak', '.zip', '.dfzip'); function findDiskWad (fname: AnsiString): AnsiString; var