Merge remote-tracking branch 'upstream/master' into develop

This commit is contained in:
EvilFactory
2024-04-26 12:31:21 -03:00
16 changed files with 97 additions and 50 deletions
@@ -123,7 +123,7 @@ namespace Barotrauma
{
Abandon = true;
}
else if (item.ParentInventory != null)
else if (item.ParentInventory != null && item.GetRootInventoryOwner() != character)
{
if (!objectiveManager.HasOrder<AIObjectiveCleanupItems>())
{
@@ -368,7 +368,7 @@ namespace Barotrauma
return new AIObjectiveGoTo(moveToTarget, character, objectiveManager, repeat: false, getDivingGearIfNeeded: AllowToFindDivingGear, closeEnough: DefaultReach)
{
// If the root container changes, the item is no longer where it was (taken by someone -> need to find another item)
AbortCondition = obj => targetItem == null || targetItem.GetRootInventoryOwner() != moveToTarget,
AbortCondition = obj => targetItem == null || (targetItem.GetRootInventoryOwner() is Entity owner && owner != moveToTarget && owner != character),
SpeakIfFails = false,
endNodeFilter = CreateEndNodeFilter(moveToTarget)
};