Faction Test 100.13.0.0

This commit is contained in:
Markus Isberg
2023-01-11 15:36:23 +02:00
parent 1650735468
commit caa5a2f762
145 changed files with 2100 additions and 1111 deletions
@@ -98,7 +98,7 @@ namespace Barotrauma
int containedItemCount = 0;
foreach (Item it in container.Inventory.AllItems)
{
if (CheckItem(it))
if (CheckItem(it) && IsInTargetSlot(it))
{
containedItemCount++;
}
@@ -118,7 +118,11 @@ namespace Barotrauma
Abandon = true;
return;
}
ItemToContain = item ?? character.Inventory.FindItem(i => CheckItem(i) && i.Container != container.Item, recursive: true);
ItemToContain = item ?? character.Inventory.FindItem(it =>
CheckItem(it) &&
//ignore items already in the container, unless we're trying to place to a specific slot, and the item's not in it
(it.Container != container.Item || (TargetSlot.HasValue && it.Container.OwnInventory.FindIndex(it) != TargetSlot)),
recursive: true);
if (ItemToContain != null)
{
if (!character.CanInteractWith(ItemToContain, checkLinked: false))