X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fgame%2Fg_res_downloader.pas;h=04048b693c983c558af1c61168f3948eee2c5823;hb=f25a08e69e17ffebfd919fd38e29684b334e6fb2;hp=fcb4ad9047279574b9622aa6158f23ed4373e7a1;hpb=d24aa2d1c64ab4c1efc19de0d1ca7a38e29ce969;p=d2df-sdl.git diff --git a/src/game/g_res_downloader.pas b/src/game/g_res_downloader.pas index fcb4ad9..04048b6 100644 --- a/src/game/g_res_downloader.pas +++ b/src/game/g_res_downloader.pas @@ -2,8 +2,7 @@ * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -140,7 +139,8 @@ begin begin mapData := MapDataFromMsgStream(msgStream); msgStream.Free; - end; + end else + mapData.FileSize := 0; for i := 0 to High(mapData.ExternalResources) do begin @@ -156,6 +156,9 @@ begin MC_SEND_ResRequest(mapData.ExternalResources[i].Name); msgStream := g_Net_Wait_Event(NET_MSG_RES_RESPONSE); + if msgStream = nil then + continue; + resData := ResDataFromMsgStream(msgStream); resStream := createDiskFile(GameDir+'/wads/'+mapData.ExternalResources[i].Name); @@ -168,6 +171,8 @@ begin end; Result := SaveWAD(MapsDir, ExtractFileName(FileName), mapData.FileData); + if mapData.FileSize = 0 then + DeleteFile(Result); end; end.