DEADSOFTWARE

also, .pk3 seems to work now
[d2df-sdl.git] / src / game / g_game.pas
index 408191bb3cd2f2876ca68d0a6cfb3dc1bb59fa81..9cca04c27ce31af3f73ea6daa86c801c7a33e004 100644 (file)
@@ -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');