Unstable 0.1500.2.0 (Rokvach's dog edition)

This commit is contained in:
Markus Isberg
2021-09-10 04:52:34 +09:00
parent e7b7c1a748
commit 1231170fce
126 changed files with 2424 additions and 1083 deletions
@@ -258,6 +258,8 @@ namespace Barotrauma
get { return capacity; }
}
public bool AllowSwappingContainedItems = true;
public Inventory(Entity owner, int capacity, int slotsPerRow = 5)
{
this.capacity = capacity;
@@ -623,6 +625,8 @@ namespace Barotrauma
protected bool TrySwapping(int index, Item item, Character user, bool createNetworkEvent, bool swapWholeStack)
{
if (item?.ParentInventory == null || !slots[index].Any()) { return false; }
if (slots[index].Items.Any(it => !it.IsInteractable(user))) { return false; }
if (!AllowSwappingContainedItems) { return false; }
//swap to InvSlotType.Any if possible
Inventory otherInventory = item.ParentInventory;