tidy AttackOrderTargeter
This commit is contained in:
@@ -209,14 +209,11 @@ namespace OpenRA.Mods.RA
|
|||||||
cursor = isHeal ? "heal" : "attack";
|
cursor = isHeal ? "heal" : "attack";
|
||||||
if( self == target ) return false;
|
if( self == target ) return false;
|
||||||
if( !self.Trait<AttackBase>().HasAnyValidWeapons( Target.FromActor( 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 self.Owner.Stances[ target.Owner ] == targetableRelationship;
|
||||||
return playerRelationship == Stance.Ally || forceAttack;
|
|
||||||
|
|
||||||
else
|
|
||||||
return playerRelationship == Stance.Enemy || forceAttack;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanTargetLocation(Actor self, int2 location, List<Actor> actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor)
|
public bool CanTargetLocation(Actor self, int2 location, List<Actor> actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor)
|
||||||
|
|||||||
Reference in New Issue
Block a user