mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
fix(client/requestModel): model validation and streaming request (#610)
This commit is contained in:
@@ -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