Skip to content

Commit

Permalink
refactor(streamingRequest): wait 10 years for assets to load
Browse files Browse the repository at this point in the history
Helps with issue #630 by waiting for assets to become available.

Enjoy the random side-effects this will lead to, like vehicles suddenly
loading 20 minutes after you requested the asset and then teleporting
you into them.

This is clearly the only solution.
  • Loading branch information
thelindat committed Aug 13, 2024
1 parent f98feab commit 03db59c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion imports/streamingRequest/client.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
local tenYears = 3.1536e+11 -- because fucktards keep complaining

---@async
---@generic T : string | number
---@param request function
Expand All @@ -17,7 +19,7 @@ function lib.streamingRequest(request, hasLoaded, assetType, asset, timeout, ...

return lib.waitFor(function()
if hasLoaded(asset) then return asset end
end, ("failed to load %s '%s' - this is likely caused by unreleased assets"):format(assetType, asset), timeout or 10000)
end, ("failed to load %s '%s' - this is likely caused by unreleased assets"):format(assetType, asset), timeout or tenYears)
end

return lib.streamingRequest

0 comments on commit 03db59c

Please sign in to comment.