(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
@@ -321,7 +321,8 @@ namespace Barotrauma
if (c.CurrentHull != hull) { continue; } if (c.CurrentHull != hull) { continue; }
if (AIObjectiveRescueAll.IsValidTarget(c, Character)) if (AIObjectiveRescueAll.IsValidTarget(c, Character))
{ {
AddTargets<AIObjectiveRescueAll, Character>(c, Character); if (AddTargets<AIObjectiveRescueAll, Character>(c, Character))
{
if (newOrder == null) if (newOrder == null)
{ {
var orderPrefab = Order.PrefabList.Find(o => o.AITag == "requestfirstaid"); var orderPrefab = Order.PrefabList.Find(o => o.AITag == "requestfirstaid");
@@ -329,6 +330,7 @@ namespace Barotrauma
} }
} }
} }
}
foreach (var gap in hull.ConnectedGaps) foreach (var gap in hull.ConnectedGaps)
{ {
if (AIObjectiveFixLeaks.IsValidTarget(gap, Character)) if (AIObjectiveFixLeaks.IsValidTarget(gap, Character))
@@ -21,6 +21,7 @@ namespace Barotrauma
public bool AddTarget(T target) public bool AddTarget(T target)
{ {
if (character.IsDead) { return false; }
if (ReportedTargets.Contains(target)) if (ReportedTargets.Contains(target))
{ {
return false; return false;