Unify Squad enemy unit filtering.

This commit is contained in:
Paul Chote
2018-12-31 15:28:26 +00:00
committed by reaperrr
parent 6fc291a634
commit 8a6a68feef
5 changed files with 17 additions and 25 deletions

View File

@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
detectedEnemyTarget = null;
var dangerRadius = owner.SquadManager.Info.DangerScanRadius;
var unitsAroundPos = owner.World.FindActorsInCircle(loc, WDist.FromCells(dangerRadius))
.Where(unit => owner.Bot.Player.Stances[unit.Owner] == Stance.Enemy).ToList();
.Where(owner.SquadManager.IsEnemyUnit).ToList();
if (!unitsAroundPos.Any())
return true;