(15bea4eef) Only ask medical assistance if there is a character with the rescue all objective. Don't allow to add targets if the bot is dead.

This commit is contained in:
Joonas Rikkonen
2019-05-23 15:07:50 +03:00
parent f3cb071b1d
commit a965314b8f
2 changed files with 7 additions and 4 deletions

View File

@@ -321,11 +321,13 @@ namespace Barotrauma
if (c.CurrentHull != hull) { continue; }
if (AIObjectiveRescueAll.IsValidTarget(c, Character))
{
AddTargets<AIObjectiveRescueAll, Character>(c, Character);
if (newOrder == null)
if (AddTargets<AIObjectiveRescueAll, Character>(c, Character))
{
var orderPrefab = Order.PrefabList.Find(o => o.AITag == "requestfirstaid");
newOrder = new Order(orderPrefab, c.CurrentHull, null, orderGiver: Character);
if (newOrder == null)
{
var orderPrefab = Order.PrefabList.Find(o => o.AITag == "requestfirstaid");
newOrder = new Order(orderPrefab, c.CurrentHull, null, orderGiver: Character);
}
}
}
}

View File

@@ -21,6 +21,7 @@ namespace Barotrauma
public bool AddTarget(T target)
{
if (character.IsDead) { return false; }
if (ReportedTargets.Contains(target))
{
return false;