Fixed #2651: Units not in world should not be added to the attack force
Otherwise, a pillbox's e1 passenger is counted as part of the attack force and ends up jamming HackyAI's attack logic until it is destroyed.
This commit is contained in:
@@ -281,7 +281,7 @@ namespace OpenRA.Mods.RA.AI
|
|||||||
|
|
||||||
var newUnits = self.World.ActorsWithTrait<IMove>()
|
var newUnits = self.World.ActorsWithTrait<IMove>()
|
||||||
.Where(a => a.Actor.Owner == p && !a.Actor.HasTrait<BaseBuilding>()
|
.Where(a => a.Actor.Owner == p && !a.Actor.HasTrait<BaseBuilding>()
|
||||||
&& !activeUnits.Contains(a.Actor))
|
&& !activeUnits.Contains(a.Actor) && a.Actor.IsInWorld)
|
||||||
.Select(a => a.Actor).ToArray();
|
.Select(a => a.Actor).ToArray();
|
||||||
|
|
||||||
foreach (var a in newUnits)
|
foreach (var a in newUnits)
|
||||||
@@ -489,4 +489,4 @@ namespace OpenRA.Mods.RA.AI
|
|||||||
aggro[e.Attacker.Owner].Aggro += e.Damage;
|
aggro[e.Attacker.Owner].Aggro += e.Damage;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user