Skip to content

Commit

Permalink
fix(client/utils): check door exists for canPickLock
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed Dec 15, 2022
1 parent 8e4d5ab commit cbf31b1
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions client/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,11 @@ end
local pickingLock

local function canPickLock(entity)
-- Linden please don't kill me thx
if pickingLock then return false end

local door = getDoorFromEntity(entity)
local hash = not door.doors and door.hash or {door.doors[1].hash, door.doors[2].hash}
if type(hash) == 'table' then
for i = 0, #hash do
if DoorSystemGetDoorState(hash[i]) == 0 then
return false
end
end
else return DoorSystemGetDoorState(hash) ~= 0 end

return not pickingLock and door?.lockpick
return door and door.lockpick and door.state == 1
end

local function pickLock(entity)
Expand Down

0 comments on commit cbf31b1

Please sign in to comment.