Hi,
There seems to be a Bug in the parameters of HandleItemOverflow. As is, when an ItemOverflowAction is created, the "itemInfoAdded" parameter is "None". Also, both originalItemInfo and rejectedItemInfo contain the same value of the Previous Item. It's not a problem for me at this point, but maybe you could point out a use case for my future reference.
However, the itemInfoAdded parameter being empty is a problem for me, because I would like to have a reference to the new ItemInfo that was added.
I think that I have pinpointed the problem:
In ItemSlotCollection, and inside the SetItemAmount(ItemInfo itemInfo, int slotIndex, bool removePreviousItem) method (line 279), first removedItemInfoAdded is initialized to ItemInfo.None (line 300), and then a call is made on line 301 to the method HandleItemOverflow(removedItem, ref removedItemInfoAdded), which is defined in the base class.
It seems to me that removedItemInfoAdded should be replaced by the SetItemAmount method's 1st parameter: "ItemInfo itemInfo", since ItemCollection.HandleItemOverflow(ItemInfo originalItemInfo, ref ItemInfo itemInfoAdded) seems to expect the itemInfoAdded and not the removedItemInfoAdded.
As a result, if an OverflowAction gets set, the call to m_OverflowOptions.OverflowAction.HandleItemOverflow(m_Inventory, originalItemInfo, itemInfoAdded, rejectedItemInfo) will still have itemInfoAdded as initialized to ItemInfo.None.
So, am I missing something, or is this a bug?
Thank you in advance.
There seems to be a Bug in the parameters of HandleItemOverflow. As is, when an ItemOverflowAction is created, the "itemInfoAdded" parameter is "None". Also, both originalItemInfo and rejectedItemInfo contain the same value of the Previous Item. It's not a problem for me at this point, but maybe you could point out a use case for my future reference.
However, the itemInfoAdded parameter being empty is a problem for me, because I would like to have a reference to the new ItemInfo that was added.
I think that I have pinpointed the problem:
In ItemSlotCollection, and inside the SetItemAmount(ItemInfo itemInfo, int slotIndex, bool removePreviousItem) method (line 279), first removedItemInfoAdded is initialized to ItemInfo.None (line 300), and then a call is made on line 301 to the method HandleItemOverflow(removedItem, ref removedItemInfoAdded), which is defined in the base class.
It seems to me that removedItemInfoAdded should be replaced by the SetItemAmount method's 1st parameter: "ItemInfo itemInfo", since ItemCollection.HandleItemOverflow(ItemInfo originalItemInfo, ref ItemInfo itemInfoAdded) seems to expect the itemInfoAdded and not the removedItemInfoAdded.
As a result, if an OverflowAction gets set, the call to m_OverflowOptions.OverflowAction.HandleItemOverflow(m_Inventory, originalItemInfo, itemInfoAdded, rejectedItemInfo) will still have itemInfoAdded as initialized to ItemInfo.None.
So, am I missing something, or is this a bug?
Thank you in advance.