Skip to content

Commit

Permalink
fix(client/utils): clear lockpicking animdict
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Apr 15, 2024
1 parent ac1a814 commit f692b71
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions client/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ local function pickLock(entity)

TaskTurnPedToFaceCoord(cache.ped, door.coords.x, door.coords.y, door.coords.z, 4000)
Wait(500)
lib.requestAnimDict('mp_common_heist')
TaskPlayAnim(cache.ped, 'mp_common_heist', 'pick_door', 3.0, 1.0, -1, 49, 0, true, true, true)

local animDict = lib.requestAnimDict('mp_common_heist')

TaskPlayAnim(cache.ped, animDict, 'pick_door', 3.0, 1.0, -1, 49, 0, true, true, true)

local success = lib.skillCheck(door.lockpickDifficulty or Config.LockDifficulty)
local rand = math.random(1, success and 100 or 5)
Expand All @@ -62,7 +64,8 @@ local function pickLock(entity)
lib.notify({ type = 'error', description = locale('lockpick_broke') })
end

StopEntityAnim(cache.ped, 'pick_door', 'mp_common_heist', 0)
StopEntityAnim(cache.ped, 'pick_door', animDict, 0)
RemoveAnimDict(animDict)

PickingLock = false
end
Expand Down

0 comments on commit f692b71

Please sign in to comment.