allow forceattack to be allowed/banned on UnitOrderTargeter
This commit is contained in:
@@ -30,6 +30,7 @@ namespace OpenRA.Mods.RA.Orders
|
|||||||
|
|
||||||
public string OrderID { get; private set; }
|
public string OrderID { get; private set; }
|
||||||
public int OrderPriority { 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)
|
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;
|
cursor = this.cursor;
|
||||||
IsQueued = forceQueued;
|
IsQueued = forceQueued;
|
||||||
|
|
||||||
|
if (ForceAttack != null && forceAttack != ForceAttack) return false;
|
||||||
|
|
||||||
var playerRelationship = self.Owner.Stances[ target.Owner ];
|
var playerRelationship = self.Owner.Stances[ target.Owner ];
|
||||||
|
|
||||||
if( !forceAttack && playerRelationship == Stance.Ally && !targetAllyUnits ) return false;
|
if( !forceAttack && playerRelationship == Stance.Ally && !targetAllyUnits ) return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user