First off, great asset. Inventory is incredibly well commented and organised.
I've been playing around with adding some additional functionality (on equip/unequip effects) for our game and discovered that UnequipItem is not reliably called. It is called when an item is dragged from the character into the backpack but not when it is unequipped via right click. It also doesn't run the unequip function when it is placed into a container via right click, again it works fine if dragged.
The first instance was easy to fix by tweaking the UseEquipmentItem function to call UnequipToInventory instead of MoveInventoryItem.
The second doesn't seem to be quite so straightforward, the issue is in UseInventoryItem when a container is open. It skips the ItemType checking and just moves the item directly into the open container rather than checking to see if it is Equipment and instead run the UseEquipmentItem function. For now I've just disabled placing from character to container and instead it runs the default UseEquipmentItem to place it back into the backpack whether a container is open or not.
I didn't see this on the list of upcoming fixes so I thought it would be best to mention it
EDIT: Just noticed that when swapping equipment the Unequip function doesn't seem to be run for the swapped out item either.
I've been playing around with adding some additional functionality (on equip/unequip effects) for our game and discovered that UnequipItem is not reliably called. It is called when an item is dragged from the character into the backpack but not when it is unequipped via right click. It also doesn't run the unequip function when it is placed into a container via right click, again it works fine if dragged.
The first instance was easy to fix by tweaking the UseEquipmentItem function to call UnequipToInventory instead of MoveInventoryItem.
The second doesn't seem to be quite so straightforward, the issue is in UseInventoryItem when a container is open. It skips the ItemType checking and just moves the item directly into the open container rather than checking to see if it is Equipment and instead run the UseEquipmentItem function. For now I've just disabled placing from character to container and instead it runs the default UseEquipmentItem to place it back into the backpack whether a container is open or not.
I didn't see this on the list of upcoming fixes so I thought it would be best to mention it

EDIT: Just noticed that when swapping equipment the Unequip function doesn't seem to be run for the swapped out item either.
Comment