mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 07:26:02 +01:00
fix(client/progress): anim task/scenario check
Correct behaviour from pull request #208. Include some refactoring to reduce repetitive table indexing.
This commit is contained in:
@@ -61,15 +61,16 @@ local controls = {
|
|||||||
local function startProgress(data)
|
local function startProgress(data)
|
||||||
playerState.invBusy = true
|
playerState.invBusy = true
|
||||||
progress = data
|
progress = data
|
||||||
|
local anim = data.anim
|
||||||
|
|
||||||
if data.anim then
|
if anim then
|
||||||
if data.anim.dict then
|
if anim.dict then
|
||||||
lib.requestAnimDict(data.anim.dict)
|
lib.requestAnimDict(anim.dict)
|
||||||
|
|
||||||
TaskPlayAnim(cache.ped, data.anim.dict, data.anim.clip, data.anim.blendIn or 3.0, data.anim.blendOut or 1.0, data.anim.duration or -1, data.anim.flag or 49, data.anim.playbackRate or 0, data.anim.lockX, data.anim.lockY, data.anim.lockZ)
|
TaskPlayAnim(cache.ped, anim.dict, anim.clip, anim.blendIn or 3.0, anim.blendOut or 1.0, anim.duration or -1, anim.flag or 49, anim.playbackRate or 0, anim.lockX, anim.lockY, anim.lockZ)
|
||||||
RemoveAnimDict(data.anim.dict)
|
RemoveAnimDict(anim.dict)
|
||||||
elseif data.anim.scenario then
|
elseif anim.scenario then
|
||||||
TaskStartScenarioInPlace(cache.ped, data.anim.scenario, 0, data.anim.playEnter ~= nil and data.anim.playEnter or true)
|
TaskStartScenarioInPlace(cache.ped, anim.scenario, 0, anim.playEnter ~= nil and anim.playEnter or true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -135,12 +136,14 @@ local function startProgress(data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if data.anim then
|
if anim then
|
||||||
StopAnimTask(cache.ped, data.anim.dict, data.anim.clip, 1.0)
|
if anim.dict then
|
||||||
Wait(0) -- This is needed here otherwise the StopAnimTask is cancelled
|
StopAnimTask(cache.ped, anim.dict, anim.clip, 1.0)
|
||||||
elseif data.anim.scenario then
|
Wait(0) -- This is needed here otherwise the StopAnimTask is cancelled
|
||||||
ClearPedTasks(cache.ped)
|
else
|
||||||
|
ClearPedTasks(cache.ped)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
playerState.invBusy = false
|
playerState.invBusy = false
|
||||||
|
|||||||
Reference in New Issue
Block a user