allow forceattack to be allowed/banned on UnitOrderTargeter

This commit is contained in:
Chris Forbes
2012-04-06 16:05:35 +12:00
parent 0ae8e41612
commit ca1549df2a

View File

@@ -30,6 +30,7 @@ namespace OpenRA.Mods.RA.Orders
public string OrderID { get; private set; }
public int OrderPriority { get; private set; }
public bool? ForceAttack = null;
public virtual bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor)
{
@@ -39,6 +40,8 @@ namespace OpenRA.Mods.RA.Orders
cursor = this.cursor;
IsQueued = forceQueued;
if (ForceAttack != null && forceAttack != ForceAttack) return false;
var playerRelationship = self.Owner.Stances[ target.Owner ];
if( !forceAttack && playerRelationship == Stance.Ally && !targetAllyUnits ) return false;