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
{
get { return (target != null && !target.IsDead() && !target.Destroyed && target.IsInWorld); }
get { return (target != null && !target.IsDead() && !target.Destroyed
&& target.IsInWorld && !target.HasTrait<Husk>()); }
}
//**********************************************************************************
@@ -508,7 +509,8 @@ namespace OpenRA.Mods.RA.AI
var enemyUnits = owner.world.FindUnitsInCircle(owner.Target.CenterLocation, Game.CellSize * 10)
.Where(unit => owner.bot.p.Stances[unit.Owner] == Stance.Enemy).ToList();
if (enemyUnits.Any())
{
{
owner.attackOrFleeFuzzy.CalculateFuzzy(owner.units, enemyUnits);
if (owner.attackOrFleeFuzzy.CanAttack)
{
@@ -1178,8 +1180,8 @@ namespace OpenRA.Mods.RA.AI
foreach (var a in unitsHangingAroundTheBase)
if (!a.HasTrait<Aircraft>())
attackForce.units.Add(a);
unitsHangingAroundTheBase.Clear();
}
unitsHangingAroundTheBase.Clear();
}
}
void TryToRushAttack()