Slot clear() doesn't auto-merge item
Steps:
- Create InventorySlot, remember_source_inventory = true
- Create InventoryStacked
- Call InventorySlot.equip with any item
- Make sure you have one more item with same prototype_id in inventory
- Call InventorySlot.clear()
Expected:
- Item returned to inventory and will be merged with another
Actual
- Item added but wasn't merged
Honestly, I don't think the remember_source_inventory property is very useful and I'm planning to remove it completely as it causing more issues than it solves. In most cases clearing the slot and adding the item to an inventory manually is much simpler to understand and causes no side-effects.
Actually, "slot" can derived "Inventory" as well, because it's inventory which can handle only one object. Then, no equip and clear are needed and everything could be done with regular transfer_item/add_item/... methods.
Yup, that's exactly what I'm planning to do for v3.0 🙂
Version 3.0.0 has been released and the remember_source_inventory has been removed from ItemSlot.