From e6b6d1f40a2d139a33808b8c4af5196b557facb4 Mon Sep 17 00:00:00 2001 From: Selt <83926739+seltonmt012@users.noreply.github.com> Date: Tue, 28 Jul 2026 01:54:04 +0200 Subject: [PATCH] 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. --- [core]/es_extended/server/classes/player.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/[core]/es_extended/server/classes/player.lua b/[core]/es_extended/server/classes/player.lua index 367c9838..231d86a9 100644 --- a/[core]/es_extended/server/classes/player.lua +++ b/[core]/es_extended/server/classes/player.lua @@ -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