Skip to content

Commit

Permalink
fix(client): replicate invBusy state
Browse files Browse the repository at this point in the history
Should resolve #1801.
  • Loading branch information
thelindat committed Sep 14, 2024
1 parent d4445fa commit 6ce273c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1532,8 +1532,8 @@ RegisterNetEvent('ox_inventory:setPlayerInventory', function(currentDrops, inven
while IsPedPlantingBomb(playerPed) do Wait(0) end

TriggerServerEvent('ox_inventory:updateWeapon', 'throw', nil, weapon.slot)
plyState:set('invBusy', false, true)

plyState.invBusy = false
currentWeapon = nil

RemoveWeaponFromPed(playerPed, weapon.hash)
Expand All @@ -1548,7 +1548,7 @@ RegisterNetEvent('ox_inventory:setPlayerInventory', function(currentDrops, inven
end
end)

plyState:set('invBusy', false, false)
plyState:set('invBusy', false, true)
plyState:set('invOpen', false, false)
plyState:set('invHotkeys', true, false)
plyState:set('canUseWeapons', true, false)
Expand Down
4 changes: 2 additions & 2 deletions modules/bridge/esx/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ local Weapon = require 'modules.weapon.client'

RegisterNetEvent('esx_policejob:handcuff', function()
PlayerData.cuffed = not PlayerData.cuffed
LocalPlayer.state:set('invBusy', PlayerData.cuffed, false)
LocalPlayer.state:set('invBusy', PlayerData.cuffed, true)

if not PlayerData.cuffed then return end

Expand All @@ -47,5 +47,5 @@ end)

RegisterNetEvent('esx_policejob:unrestrain', function()
PlayerData.cuffed = false
LocalPlayer.state:set('invBusy', PlayerData.cuffed, false)
LocalPlayer.state:set('invBusy', PlayerData.cuffed, true)
end)

0 comments on commit 6ce273c

Please sign in to comment.