(f0837188e) Bots now target only reported targets when the objective is not an order.

This commit is contained in:
Joonas Rikkonen
2019-05-16 05:31:48 +03:00
parent 4f825ce309
commit 5f610caadd
16 changed files with 272 additions and 353 deletions
@@ -25,14 +25,12 @@ namespace Barotrauma
protected override bool Filter(Gap gap)
{
bool ignore = gap.ConnectedWall == null || gap.ConnectedDoor != null || gap.Open <= 0 || gap.linkedTo.All(l => l == null);
if (!ignore)
{
if (gap.Submarine == null) { ignore = true; }
else if (gap.Submarine.TeamID != character.TeamID) { ignore = true; }
else if (character.Submarine != null && !character.Submarine.IsEntityFoundOnThisSub(gap, true)) { ignore = true; }
}
return !ignore;
if (gap == null) { return false; }
if (gap.ConnectedWall == null || gap.ConnectedDoor != null || gap.Open <= 0 || gap.linkedTo.All(l => l == null)) { return false; }
if (gap.Submarine == null) { return false; }
if (gap.Submarine.TeamID != character.TeamID) { return false; }
if (character.Submarine != null && !character.Submarine.IsEntityFoundOnThisSub(gap, true)) { return false; }
return true;
}
public static float GetLeakSeverity(Gap leak)