(546717195) Use the AIObjectiveFightIntruders.IsValidTarget for deciding whether or not the button should flash.

This commit is contained in:
Joonas Rikkonen
2019-05-16 06:55:43 +03:00
parent 5435adc9b4
commit f38aa90847
20 changed files with 200 additions and 243 deletions
@@ -1450,10 +1450,7 @@ namespace Barotrauma
bool hasLeaks = Character.Controlled.CurrentHull.ConnectedGaps.Any(g => !g.IsRoomToRoom && g.Open > 0.0f);
ToggleReportButton("reportbreach", hasLeaks);
bool hasIntruders = Character.CharacterList.Any(c =>
c.CurrentHull == Character.Controlled.CurrentHull && !c.IsDead &&
(c.AIController is EnemyAIController || (c.TeamID != Character.Controlled.TeamID && c.TeamID != Character.TeamType.FriendlyNPC)));
bool hasIntruders = Character.CharacterList.Any(c => c.CurrentHull == Character.Controlled.CurrentHull && AIObjectiveFightIntruders.IsValidTarget(Character.Controlled, c));
ToggleReportButton("reportintruders", hasIntruders);
foreach (GUIComponent reportButton in reportButtonFrame.Children)