edited April 2020 in ORK Scripting

I'm using the combatant.Inventory.ContentChanged event. I check the value of the IInventoryShortcut item parameter of the event with equipment parts' equipment to identify the last equipped item. Everything works fine when the quantity of the item is 1, but as soon as the quantity is more than 1 in the inventory, the equipped item does not match with the removed inventory item anymore.

It's like if the item that is removed from the inventory (as indicated by the item parameter of the Inventory.ContentChanged event) is not exactly the same as the item that is equipped.

Is this expected behavior?
Post edited by ArsMagika on
  • How are you checking it?

    If you're checking for same instance, that'll be a problem, because the equipped weapon will be a separate instance (a copy with quantity 1 and the inventory's quantity reduced).

    You can use the IsEqual function of the shortcut to check if they have equal values.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • I was checking with "==". I tried with isEqual and it solved the issue. Thanks!
Sign In or Register to comment.