Skip to content

Commit

Permalink
fix(client/weapon): always trigger updateWeapon when disarming player
Browse files Browse the repository at this point in the history
Other scripts triggering disarm may not remove the cached
weapon value on the server.
Resolves #1634
  • Loading branch information
thelindat committed Mar 14, 2024
1 parent 343c3a0 commit 2b0224c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions modules/weapon/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ function Weapon.Disarm(currentWeapon, noAnim)
if currentWeapon?.timer then
currentWeapon.timer = nil

if source == '' then
TriggerServerEvent('ox_inventory:updateWeapon')
end

TriggerServerEvent('ox_inventory:updateWeapon')
SetPedAmmo(cache.ped, currentWeapon.hash, 0)

if client.weaponanims and not noAnim then
Expand Down

0 comments on commit 2b0224c

Please sign in to comment.