mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
refactor(imports/streaming): use coroutine.isyieldable
This commit is contained in:
@@ -15,7 +15,7 @@ function lib.requestAnimDict(animDict, timeout)
|
||||
|
||||
RequestAnimDict(animDict)
|
||||
|
||||
if coroutine.running() then
|
||||
if coroutine.isyieldable() then
|
||||
timeout = tonumber(timeout) or 500
|
||||
|
||||
for _ = 1, timeout do
|
||||
|
||||
@@ -11,7 +11,7 @@ function lib.requestAnimSet(animSet, timeout)
|
||||
|
||||
RequestAnimSet(animSet)
|
||||
|
||||
if coroutine.running() then
|
||||
if coroutine.isyieldable() then
|
||||
timeout = tonumber(timeout) or 500
|
||||
|
||||
for _ = 1, timeout do
|
||||
|
||||
@@ -13,7 +13,7 @@ function lib.requestModel(model, timeout)
|
||||
|
||||
RequestModel(model)
|
||||
|
||||
if coroutine.running() then
|
||||
if coroutine.isyieldable() then
|
||||
timeout = tonumber(timeout) or 500
|
||||
|
||||
for _ = 1, timeout do
|
||||
|
||||
@@ -11,7 +11,7 @@ function lib.requestNamedPtfxAsset(ptFxName, timeout)
|
||||
|
||||
RequestNamedPtfxAsset(ptFxName)
|
||||
|
||||
if coroutine.running() then
|
||||
if coroutine.isyieldable() then
|
||||
timeout = tonumber(timeout) or 500
|
||||
|
||||
for _ = 1, timeout do
|
||||
|
||||
@@ -11,7 +11,7 @@ function lib.requestScaleformMovie(scaleformName, timeout)
|
||||
|
||||
if HasScaleformMovieLoaded(scaleform) then return scaleform end
|
||||
|
||||
if coroutine.running() then
|
||||
if coroutine.isyieldable() then
|
||||
timeout = tonumber(timeout) or 500
|
||||
|
||||
for _ = 1, timeout do
|
||||
@@ -28,4 +28,4 @@ function lib.requestScaleformMovie(scaleformName, timeout)
|
||||
return scaleform
|
||||
end
|
||||
|
||||
return lib.requestScaleformMovie
|
||||
return lib.requestScaleformMovie
|
||||
|
||||
@@ -11,7 +11,7 @@ function lib.requestStreamedTextureDict(textureDict, timeout)
|
||||
|
||||
RequestStreamedTextureDict(textureDict, false)
|
||||
|
||||
if coroutine.running() then
|
||||
if coroutine.isyieldable() then
|
||||
timeout = tonumber(timeout) or 500
|
||||
|
||||
for _ = 1, timeout do
|
||||
|
||||
@@ -40,7 +40,7 @@ function lib.requestWeaponAsset(weaponType, timeout, weaponResourceFlags, extraW
|
||||
|
||||
RequestWeaponAsset(weaponType, weaponResourceFlags or 31, extraWeaponComponentFlags or 0)
|
||||
|
||||
if coroutine.running() then
|
||||
if coroutine.isyieldable() then
|
||||
timeout = tonumber(timeout) or 500
|
||||
|
||||
for _ = 1, timeout do
|
||||
|
||||
Reference in New Issue
Block a user