From: Ketmar Dark Date: Sat, 12 Oct 2019 01:01:00 +0000 (+0300) Subject: net: do not create download directories when there is nothing to download X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=3d0c4a004924824fadd819e09835b3471df144a8;p=d2df-sdl.git net: do not create download directories when there is nothing to download --- diff --git a/src/game/g_res_downloader.pas b/src/game/g_res_downloader.pas index d9cf568..ae645a1 100644 --- a/src/game/g_res_downloader.pas +++ b/src/game/g_res_downloader.pas @@ -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