Steps to reproduce:
-
In inventory, have a stackable item (I tested with both the mana potions and the scrolls) and at least one empty inventory slot.
-
In equipment slots, have a slot that contains an item (hat, dagger, hammer, doesn’t matter).
-
Drag the stackable item from the inventory slot over to the equipment slot that has an item in it.
Expected result: The stackable item returns to inventory, the equipment item remains equipped.
Actual result: The stackable item returns to inventory, but the equipped piece of gear is unequipped and placed in inventory.
Solution:
In DragItem.cs --> AttemptSwap(), a couple of additional checks are needed…
// Abort if we can't do a successful swap
if (source.MaxAcceptable(removedDestinationItem) < removedDestinationNumber ||
destination.MaxAcceptable(removedSourceItem) < removedSourceNumber ||
destination.MaxAcceptable(removedSourceItem) == 0 || //added check
source.MaxAcceptable(removedDestinationItem) == 0 //added check
)
Result: attempting to drop a stackable item onto an equipment slot no longer unequips the item.