husks are invalid targets
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user