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

@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Traits.BotModules.Squads
if (u.Owner == squad.Bot.Player && u.Info.HasTraitInfo<BuildingInfo>())
return false;
var enemyAroundUnit = units.Where(unit => squad.Bot.Player.Stances[unit.Owner] == Stance.Enemy && unit.Info.HasTraitInfo<AttackBaseInfo>());
var enemyAroundUnit = units.Where(unit => squad.SquadManager.IsEnemyUnit(unit) && unit.Info.HasTraitInfo<AttackBaseInfo>());
if (!enemyAroundUnit.Any())
return false;