I am using UIS with UCC. If I have two of the same item on my hotbar, both are then in the equippable collection. This will create two of the same character item game objects. Then if one of these items is removed, either by consuming it or dropping it, neither of the character objects is removed. If the remaining item is then removed, it will remove one of the character items. This leaves an orphaned character item under the Items game object on the character.
There are a couple things to mention about my setup. Firstly, I have made UIS multiplayer and so many of the transactions are passed through the networking code and not directly called from the UI, I don't think this is my bug but worth mentioning in case it is
. Secondly, this is only an issue for Mutable/Non Unique items. It is not an issue for Mutable/Unique Items. I have Mutable/Non unique items for stackable consumables so that I can assign attributes for things like Durability and Entity ID.
The problem occurs in InventoryBase.RemoveItemIdentifierAmountInternal. The code that should remove the character item, doesn't because the variables slotID is -1 and newAmount is a positive amount due to the second item in the collection. See the screen capture. The SlotID is ignored when OnRemoveItemInventory calls RemoveItemIdentifierAmountInternal. And the amount is positive because when GetItemIdentifierAmount is called, all similar item quantities are accumulated.
The second screen capture shows my debugging notes for the call stack that leads to this.
If this is fixable, could you please provide a code fix?
UCC Version: 3.1.3
UIS Version: 1.2.22
Unity 6: 6000.0.32f1 (URP)


There are a couple things to mention about my setup. Firstly, I have made UIS multiplayer and so many of the transactions are passed through the networking code and not directly called from the UI, I don't think this is my bug but worth mentioning in case it is

The problem occurs in InventoryBase.RemoveItemIdentifierAmountInternal. The code that should remove the character item, doesn't because the variables slotID is -1 and newAmount is a positive amount due to the second item in the collection. See the screen capture. The SlotID is ignored when OnRemoveItemInventory calls RemoveItemIdentifierAmountInternal. And the amount is positive because when GetItemIdentifierAmount is called, all similar item quantities are accumulated.
The second screen capture shows my debugging notes for the call stack that leads to this.
If this is fixable, could you please provide a code fix?
UCC Version: 3.1.3
UIS Version: 1.2.22
Unity 6: 6000.0.32f1 (URP)


Last edited: