I have a heavily edited "inventory box type" custom script for inventories and containers, but I believe this is an AC bug:
I believe this is similar to a bug I reported last year (which has been fixed):
Suppose ItemA has "can carry multiple?" unchecked. There is one copy of ItemA in your inventory, and another copy in the container. If you click on the container copy and take it to the inventory, the inventory (correctly) won't take it. But if you take a different item (ItemD) from the inventory and click on the container copy of ItemA, they will swap places and you will have two copies of ItemA even though you aren't supposed to!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Thanks for the details, I'll attempt a recreation.
Can you share details/screenshots of the InventoryBox element that causes the issue? If you're using a custom script to handle it's behaviour, please share it as well.
Here it is there whole thing:
This is the offending bit:
collectionClicked.Insert(selectedInstance, slot, OccupiedSlotBehaviour.SwapItems);
Copy/paste this above it:
sourceContainer.categoryIDs.Contains (clickedInstance.InvItem.id)
It doesn't work because this is returning false, but it definitely should be returning true because the item is not in a category that is allowed (and AC automatically recognises this when you try to swap it the other way around, selecting the disallowed item in the inventory and clicking on an item in the container).
Just done some testing: the issue here is that sourceContainer.categoryIDs is a list of categoryIDs, not of item IDs within each categoryID.
My mistake.
Ah thanks! Minor adjustment:
Since we want to prevent the interaction if the item's category isn't checked as allowed (categoryIDs is a whitelist, not a blacklist).