Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit 66a8608

Browse files
committed
refactor(client): change canUseItem requirements
Complaints about restrictiveness. Resolves #1090.
1 parent 21833d0 commit 66a8608

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

client.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,15 @@ lib.callback.register('ox_inventory:usingItem', function(data)
260260
end)
261261

262262
local function canUseItem(isAmmo)
263-
return PlayerData.loaded
263+
local ped = cache.ped
264+
265+
return (not isAmmo or currentWeapon)
266+
and PlayerData.loaded
264267
and not PlayerData.dead
265268
and not invBusy
266269
and not lib.progressActive()
267-
and (IsPlayerFreeForAmbientTask(cache.playerId)
268-
or cache.vehicle
269-
or (isAmmo and currentWeapon and IsPlayerFreeAiming(cache.playerId))
270-
or IsPedInCover(cache.ped, false))
270+
and not IsPedRagdoll(ped)
271+
and not IsPedFalling(ped)
271272
end
272273

273274
---@param data table

0 commit comments

Comments
 (0)