DEADSOFTWARE

net: do not create download directories when there is nothing to download
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Sat, 12 Oct 2019 01:01:00 +0000 (04:01 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Sat, 12 Oct 2019 15:54:12 +0000 (18:54 +0300)
src/game/g_res_downloader.pas

index d9cf5684c508c43eed986b311e1dcad0aba5a6f9..ae645a1196677443c505ee10f75dcd0e16f63193 100644 (file)
@@ -167,16 +167,6 @@ begin
   g_Res_ClearReplacementWads();
   g_Res_received_map_start := false;
 
-  try
-    CreateDir(GameDir+'/maps/downloads');
-  except
-  end;
-
-  try
-    CreateDir(GameDir+'/wads/downloads');
-  except
-  end;
-
   resList := TStringList.Create();
 
   try
@@ -203,6 +193,10 @@ begin
         result := '';
         exit;
       end;
+      try
+        CreateDir(GameDir+'/maps/downloads');
+      except
+      end;
       fname := GameDir+'/maps/downloads/'+FileName;
       try
         strm := createDiskFile(fname);
@@ -244,6 +238,10 @@ begin
       end
       else
       begin
+        try
+          CreateDir(GameDir+'/wads/downloads');
+        except
+        end;
         fname := GameDir+'/wads/downloads/'+tf.diskName;
         e_LogWritefln('downloading resource `%s` to `%s`...', [tf.diskName, fname]);
         try