Skip to content

Commit 7f30c14

Browse files
committed
Chobby retries game downloads as map downloads.
Apparently the infrastructure hosts games as maps. The widgets outside the download api are unaffected by this technicality.
1 parent 9485559 commit 7f30c14

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

LuaMenu/widgets/api_download_handler.lua

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ end
116116
local function GetDownloadIndex(downloadList, name, fileType)
117117
for i = 1, #downloadList do
118118
local data = downloadList[i]
119-
if data.name == name and data.fileType == fileType then
119+
if data.name == name and (data.fileType == fileType or fileType == "map") then
120120
return i
121121
end
122122
end
@@ -157,6 +157,8 @@ local function RemoveDownload(name, fileType, putInRemoveList, removalType)
157157
return false
158158
end
159159

160+
fileType = downloadQueue[index].fileType or fileType
161+
160162
if removalType == "success" then
161163
CallListeners("DownloadFinished", downloadQueue[index].id, name, fileType)
162164
else
@@ -286,7 +288,11 @@ function wrapperFunctions.DownloadFinished(name, fileType, success, aborted)
286288
if not VFS.HasArchive(name) then
287289
VFS.ScanAllDirs() -- Find downloaded file (if it exists).
288290
end
289-
RemoveDownload(name, fileType, true, (aborted and "cancel") or (success and "success") or "fail")
291+
if not success and not aborted and fileType == "game" then
292+
WG.WrapperLoopback.DownloadFile(name, typeMap["map"])
293+
else
294+
RemoveDownload(name, fileType, true, (aborted and "cancel") or (success and "success") or "fail")
295+
end
290296
end
291297

292298
--Chotify:Post({

0 commit comments

Comments
 (0)