mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-28 21:14:44 +00:00
fix(client/requestModel): model validation and streaming request (#610)
This commit is contained in:
1 parent
abad423aff
commit
e12a7fd273
1 file changed
+2
-2
@@ -6,11 +6,11 @@ function lib.requestModel(model, timeout)
|
|||||||
if type(model) ~= 'number' then model = joaat(model) end
|
if type(model) ~= 'number' then model = joaat(model) end
|
||||||
if HasModelLoaded(model) then return model end
|
if HasModelLoaded(model) then return model end
|
||||||
|
|
||||||
if not IsModelValid(model) then
|
if not IsModelValid(model) and not IsModelInCdimage(model) then
|
||||||
error(("attempted to load invalid model '%s'"):format(model))
|
error(("attempted to load invalid model '%s'"):format(model))
|
||||||
end
|
end
|
||||||
|
|
||||||
return lib.streamingRequest(IsModelInCdimage, HasModelLoaded, 'model', model, timeout)
|
return lib.streamingRequest(RequestModel, HasModelLoaded, 'model', model, timeout)
|
||||||
end
|
end
|
||||||
|
|
||||||
return lib.requestModel
|
return lib.requestModel
|
||||||
Reference in new issue
Block a user