tidy AttackOrderTargeter

This commit is contained in:
Chris Forbes
2011-11-25 17:38:58 +13:00
parent 2679e91b03
commit 54e8266e37

View File

@@ -209,14 +209,11 @@ namespace OpenRA.Mods.RA
cursor = isHeal ? "heal" : "attack";
if( self == target ) return false;
if( !self.Trait<AttackBase>().HasAnyValidWeapons( Target.FromActor( target ) ) ) return false;
if (forceAttack) return true;
var playerRelationship = self.Owner.Stances[ target.Owner ];
var targetableRelationship = isHeal ? Stance.Ally : Stance.Enemy;
if( isHeal )
return playerRelationship == Stance.Ally || forceAttack;
else
return playerRelationship == Stance.Enemy || forceAttack;
return self.Owner.Stances[ target.Owner ] == targetableRelationship;
}
public bool CanTargetLocation(Actor self, int2 location, List<Actor> actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor)