husks are invalid targets

This commit is contained in:
Matthias Mailänder
2013-03-06 11:35:21 +01:00
parent 5d2b704608
commit f6d4b860ee
2 changed files with 8 additions and 6 deletions

View File

@@ -150,7 +150,8 @@ namespace OpenRA.Mods.RA.AI
public bool TargetIsValid public bool TargetIsValid
{ {
get { return (target != null && !target.IsDead() && !target.Destroyed && target.IsInWorld); } get { return (target != null && !target.IsDead() && !target.Destroyed
&& target.IsInWorld && !target.HasTrait<Husk>()); }
} }
//********************************************************************************** //**********************************************************************************
@@ -508,6 +509,7 @@ namespace OpenRA.Mods.RA.AI
var enemyUnits = owner.world.FindUnitsInCircle(owner.Target.CenterLocation, Game.CellSize * 10) var enemyUnits = owner.world.FindUnitsInCircle(owner.Target.CenterLocation, Game.CellSize * 10)
.Where(unit => owner.bot.p.Stances[unit.Owner] == Stance.Enemy).ToList(); .Where(unit => owner.bot.p.Stances[unit.Owner] == Stance.Enemy).ToList();
if (enemyUnits.Any()) if (enemyUnits.Any())
{ {
owner.attackOrFleeFuzzy.CalculateFuzzy(owner.units, enemyUnits); owner.attackOrFleeFuzzy.CalculateFuzzy(owner.units, enemyUnits);
if (owner.attackOrFleeFuzzy.CanAttack) if (owner.attackOrFleeFuzzy.CanAttack)