mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 23:01:26 +00:00
fix(es_extended/server/classes/player): make setInventoryItem a no-op on no change
Setting an item to the count it already has sent a zero difference to removeInventoryItem, which treats zero as an error and calls error(). That unwinds out of the caller, so anything after the call was skipped.
This commit is contained in:
@@ -505,6 +505,10 @@ function CreateExtendedPlayer(playerId, identifier, ssn, group, accounts, invent
|
||||
if item and count >= 0 then
|
||||
count = ESX.Math.Round(count)
|
||||
|
||||
if count == item.count then
|
||||
return
|
||||
end
|
||||
|
||||
if count > item.count then
|
||||
self.addInventoryItem(item.name, count - item.count)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user