From: Ketmar Dark Date: Sun, 20 Oct 2019 22:06:34 +0000 (+0300) Subject: utils: better `isWadPath()` X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=4e2a6e58df94b7b9ff9ae2da91c5b7336fda5d92;p=d2df-sdl.git utils: better `isWadPath()` --- diff --git a/src/shared/utils.pas b/src/shared/utils.pas index a3a6500..5c3c7ba 100644 --- a/src/shared/utils.pas +++ b/src/shared/utils.pas @@ -885,7 +885,7 @@ end; function isWadPath (const fn: AnsiString): Boolean; var pos: Integer; - s: AnsiString; + s, wext: AnsiString; begin result := false; pos := 1; @@ -897,10 +897,13 @@ begin if (pos-4 > 1) and (fn[pos-4] = '.') and ((fn[pos+1] = '\') or (fn[pos+1] = '/')) then begin s := Copy(fn, pos-4, 4); - if StrEquCI1251(s, '.wad') or StrEquCI1251(s, '.pk3') or StrEquCI1251(s, '.zip') or StrEquCI1251(s, '.dfz') then + for wext in wadExtensions do begin - result := true; - exit; + if strEquCI1251(s, wext) then + begin + result := true; + exit; + end; end; end; end;