Fixed AIObjectiveGoto terminating if previous path was unreachable, BackGroundSpriteManager won't place a sprite if a suitable position isn't found, StatusEffect fire position fix, UI improvements, door convexhull fix, progress on Fabricators & Deconstructors, mapentities sorted by category in edit mode, item descriptions, TutorialMode refactoring to make it easier to add new types of tutorials
This commit is contained in:
@@ -90,35 +90,42 @@ namespace Barotrauma
|
||||
{
|
||||
character.Inventory.TryPutItem(targetItem, targetSlot, false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i<10 && currSearchIndex<Item.ItemList.Count; i++)
|
||||
for (int i = 0; i<10 && currSearchIndex<Item.ItemList.Count-2; i++)
|
||||
{
|
||||
currSearchIndex++;
|
||||
|
||||
if (!Item.ItemList[currSearchIndex].HasTag(itemName) && Item.ItemList[currSearchIndex].Name != itemName) continue;
|
||||
if (IgnoreContainedItems && Item.ItemList[currSearchIndex].container != null) continue;
|
||||
if (Item.ItemList[currSearchIndex].inventory is CharacterInventory) continue;
|
||||
|
||||
targetItem = Item.ItemList[currSearchIndex];
|
||||
|
||||
targetItem = Item.ItemList[currSearchIndex];
|
||||
|
||||
AddGoToObjective(targetItem);
|
||||
|
||||
Item moveToTarget = targetItem;
|
||||
while (moveToTarget.container != null)
|
||||
{
|
||||
moveToTarget = moveToTarget.container;
|
||||
}
|
||||
|
||||
subObjectives.Add(new AIObjectiveGoTo(moveToTarget, character));
|
||||
return;
|
||||
}
|
||||
|
||||
if (currSearchIndex >= Item.ItemList.Count) canBeCompleted = false;
|
||||
}
|
||||
|
||||
private void AddGoToObjective(Item item)
|
||||
{
|
||||
Item moveToTarget = item;
|
||||
while (moveToTarget.container != null)
|
||||
{
|
||||
moveToTarget = moveToTarget.container;
|
||||
}
|
||||
|
||||
AddSubObjective(new AIObjectiveGoTo(moveToTarget, character));
|
||||
}
|
||||
|
||||
public override bool IsDuplicate(AIObjective otherObjective)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user