From 257bd6f43155b0d90f898d06a7f65863725244f4 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 16 Aug 2011 18:58:50 +1200 Subject: [PATCH] fixed #849 -- forceMove plumbing removed, noone uses it. --- OpenRA.Game/Orders/UnitOrderGenerator.cs | 5 ++--- OpenRA.Game/Traits/TraitsInterfaces.cs | 4 ++-- OpenRA.Mods.RA/Air/Aircraft.cs | 4 ++-- OpenRA.Mods.RA/AttackBase.cs | 4 ++-- OpenRA.Mods.RA/Captures.cs | 4 ++-- OpenRA.Mods.RA/EngineerRepair.cs | 8 +++----- OpenRA.Mods.RA/Harvester.cs | 4 ++-- OpenRA.Mods.RA/Minelayer.cs | 4 ++-- OpenRA.Mods.RA/Move/Mobile.cs | 4 ++-- OpenRA.Mods.RA/Orders/DeployOrderTargeter.cs | 4 ++-- OpenRA.Mods.RA/Orders/EnterBuildingOrderTargeter.cs | 4 ++-- OpenRA.Mods.RA/Orders/UnitOrderTargeter.cs | 8 ++++---- OpenRA.Mods.RA/RallyPoint.cs | 4 ++-- OpenRA.Mods.RA/SupplyTruck.cs | 4 ++-- 14 files changed, 31 insertions(+), 34 deletions(-) diff --git a/OpenRA.Game/Orders/UnitOrderGenerator.cs b/OpenRA.Game/Orders/UnitOrderGenerator.cs index 1a690564ed..f25e0d249a 100644 --- a/OpenRA.Game/Orders/UnitOrderGenerator.cs +++ b/OpenRA.Game/Orders/UnitOrderGenerator.cs @@ -90,13 +90,12 @@ namespace OpenRA.Orders var actorsAt = self.World.ActorMap.GetUnitsAt( xy ).ToList(); var forceAttack = mi.Modifiers.HasModifier(Modifiers.Ctrl); - var forceMove = mi.Modifiers.HasModifier(Modifiers.Alt); var forceQueue = mi.Modifiers.HasModifier(Modifiers.Shift); string cursor = null; if( underCursor != null ) - if (o.Order.CanTargetActor(self, underCursor, forceAttack, forceMove, forceQueue, ref cursor)) + if (o.Order.CanTargetActor(self, underCursor, forceAttack, forceQueue, ref cursor)) return new UnitOrderResult( self, o.Order, o.Trait, cursor, Target.FromActor( underCursor ) ); - if (o.Order.CanTargetLocation(self, xy, actorsAt, forceAttack, forceMove, forceQueue, ref cursor)) + if (o.Order.CanTargetLocation(self, xy, actorsAt, forceAttack, forceQueue, ref cursor)) return new UnitOrderResult( self, o.Order, o.Trait, cursor, Target.FromCell( xy ) ); } } diff --git a/OpenRA.Game/Traits/TraitsInterfaces.cs b/OpenRA.Game/Traits/TraitsInterfaces.cs index c9f6b8ea35..6b121c1320 100755 --- a/OpenRA.Game/Traits/TraitsInterfaces.cs +++ b/OpenRA.Game/Traits/TraitsInterfaces.cs @@ -45,8 +45,8 @@ namespace OpenRA.Traits { string OrderID { get; } int OrderPriority { get; } - bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueue, ref string cursor); - bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceMove, bool forceQueue, ref string cursor); + bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueue, ref string cursor); + bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceQueue, ref string cursor); bool IsQueued { get; } } diff --git a/OpenRA.Mods.RA/Air/Aircraft.cs b/OpenRA.Mods.RA/Air/Aircraft.cs index 76cc5b0a5c..e23f4a1fec 100755 --- a/OpenRA.Mods.RA/Air/Aircraft.cs +++ b/OpenRA.Mods.RA/Air/Aircraft.cs @@ -247,12 +247,12 @@ namespace OpenRA.Mods.RA.Air public string OrderID { get { return "Move"; } } public int OrderPriority { get { return 4; } } - public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { return false; } - public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor) { IsQueued = forceQueued; cursor = self.World.Map.IsInMap(location) ? "move" : "move-blocked"; diff --git a/OpenRA.Mods.RA/AttackBase.cs b/OpenRA.Mods.RA/AttackBase.cs index ca9179f57b..e041a3d6ab 100644 --- a/OpenRA.Mods.RA/AttackBase.cs +++ b/OpenRA.Mods.RA/AttackBase.cs @@ -203,7 +203,7 @@ namespace OpenRA.Mods.RA public string OrderID { get; private set; } public int OrderPriority { get; private set; } - public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { IsQueued = forceQueued; @@ -220,7 +220,7 @@ namespace OpenRA.Mods.RA return playerRelationship == Stance.Enemy || forceAttack; } - public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor) { if (!self.World.Map.IsInMap(location)) return false; diff --git a/OpenRA.Mods.RA/Captures.cs b/OpenRA.Mods.RA/Captures.cs index 1efdf59dc1..d074716a2c 100644 --- a/OpenRA.Mods.RA/Captures.cs +++ b/OpenRA.Mods.RA/Captures.cs @@ -75,9 +75,9 @@ namespace OpenRA.Mods.RA this.captureTypes = captureTypes; } - public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { - if( !base.CanTargetActor( self, target, forceAttack, forceMove, forceQueued, ref cursor ) ) return false; + if( !base.CanTargetActor( self, target, forceAttack, forceQueued, ref cursor ) ) return false; var ci = target.Info.Traits.Get(); var playerRelationship = self.Owner.Stances[ target.Owner ]; diff --git a/OpenRA.Mods.RA/EngineerRepair.cs b/OpenRA.Mods.RA/EngineerRepair.cs index f67acb92d4..9224c2c96e 100644 --- a/OpenRA.Mods.RA/EngineerRepair.cs +++ b/OpenRA.Mods.RA/EngineerRepair.cs @@ -56,13 +56,11 @@ namespace OpenRA.Mods.RA class EngineerRepairOrderTargeter : UnitTraitOrderTargeter { public EngineerRepairOrderTargeter() - : base( "EngineerRepair", 6, "goldwrench", false, true ) - { - } + : base( "EngineerRepair", 6, "goldwrench", false, true ) { } - public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { - if( !base.CanTargetActor( self, target, forceAttack, forceMove, forceQueued, ref cursor ) ) return false; + if( !base.CanTargetActor( self, target, forceAttack, forceQueued, ref cursor ) ) return false; if (!target.HasTrait()) return false; diff --git a/OpenRA.Mods.RA/Harvester.cs b/OpenRA.Mods.RA/Harvester.cs index eb584be54c..304fe401da 100644 --- a/OpenRA.Mods.RA/Harvester.cs +++ b/OpenRA.Mods.RA/Harvester.cs @@ -219,12 +219,12 @@ namespace OpenRA.Mods.RA public string OrderID { get { return "Harvest";}} public int OrderPriority { get { return 10; } } - public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { return false; } - public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor) { // Don't leak info about resources under the shroud if (!self.World.LocalShroud.IsExplored(location)) return false; diff --git a/OpenRA.Mods.RA/Minelayer.cs b/OpenRA.Mods.RA/Minelayer.cs index 09f0fdc570..7590912a88 100644 --- a/OpenRA.Mods.RA/Minelayer.cs +++ b/OpenRA.Mods.RA/Minelayer.cs @@ -153,12 +153,12 @@ namespace OpenRA.Mods.RA public string OrderID { get { return "BeginMinefield"; } } public int OrderPriority { get { return 5; } } - public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { return false; } - public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor) { if (!self.World.Map.IsInMap(location)) return false; diff --git a/OpenRA.Mods.RA/Move/Mobile.cs b/OpenRA.Mods.RA/Move/Mobile.cs index 1766356667..d8de266451 100755 --- a/OpenRA.Mods.RA/Move/Mobile.cs +++ b/OpenRA.Mods.RA/Move/Mobile.cs @@ -433,12 +433,12 @@ namespace OpenRA.Mods.RA.Move public int OrderPriority { get { return 4; } } public bool IsQueued { get; protected set; } - public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { return false; } - public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor) { IsQueued = forceQueued; cursor = "move"; diff --git a/OpenRA.Mods.RA/Orders/DeployOrderTargeter.cs b/OpenRA.Mods.RA/Orders/DeployOrderTargeter.cs index e5f8addb2a..059e92a9a0 100755 --- a/OpenRA.Mods.RA/Orders/DeployOrderTargeter.cs +++ b/OpenRA.Mods.RA/Orders/DeployOrderTargeter.cs @@ -35,14 +35,14 @@ namespace OpenRA.Mods.RA.Orders public string OrderID { get; private set; } public int OrderPriority { get; private set; } - public bool CanTargetActor( Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor ) + public bool CanTargetActor( Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor ) { IsQueued = forceQueued; cursor = useDeployCursor() ? "deploy" : "deploy-blocked"; return self == target; } - public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor) { return false; } diff --git a/OpenRA.Mods.RA/Orders/EnterBuildingOrderTargeter.cs b/OpenRA.Mods.RA/Orders/EnterBuildingOrderTargeter.cs index fc2b7f33e7..6a2f41529e 100755 --- a/OpenRA.Mods.RA/Orders/EnterBuildingOrderTargeter.cs +++ b/OpenRA.Mods.RA/Orders/EnterBuildingOrderTargeter.cs @@ -25,9 +25,9 @@ namespace OpenRA.Mods.RA.Orders this.useEnterCursor = useEnterCursor; } - public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { - if( !base.CanTargetActor( self, target, forceAttack, forceMove, forceQueued, ref cursor ) ) return false; + if( !base.CanTargetActor( self, target, forceAttack, forceQueued, ref cursor ) ) return false; if( !canTarget( target ) ) return false; cursor = useEnterCursor(target) ? "enter" : "enter-blocked"; IsQueued = forceQueued; diff --git a/OpenRA.Mods.RA/Orders/UnitOrderTargeter.cs b/OpenRA.Mods.RA/Orders/UnitOrderTargeter.cs index 83decce9a2..e5d3809eea 100755 --- a/OpenRA.Mods.RA/Orders/UnitOrderTargeter.cs +++ b/OpenRA.Mods.RA/Orders/UnitOrderTargeter.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Orders public string OrderID { get; private set; } public int OrderPriority { get; private set; } - public virtual bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public virtual bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { if( self == null ) throw new ArgumentNullException( "self" ); if( target == null ) throw new ArgumentNullException( "target" ); @@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Orders return true; } - public virtual bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public virtual bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor) { return false; } @@ -61,9 +61,9 @@ namespace OpenRA.Mods.RA.Orders { } - public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { - if( !base.CanTargetActor( self, target, forceAttack, forceMove, forceQueued, ref cursor ) ) return false; + if( !base.CanTargetActor( self, target, forceAttack, forceQueued, ref cursor ) ) return false; if( !target.HasTrait() ) return false; IsQueued = forceQueued; diff --git a/OpenRA.Mods.RA/RallyPoint.cs b/OpenRA.Mods.RA/RallyPoint.cs index 1e1c853656..b1855179b4 100755 --- a/OpenRA.Mods.RA/RallyPoint.cs +++ b/OpenRA.Mods.RA/RallyPoint.cs @@ -59,12 +59,12 @@ namespace OpenRA.Mods.RA public string OrderID { get { return "SetRallyPoint"; } } public int OrderPriority { get { return 0; } } - public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { return false; } - public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public bool CanTargetLocation(Actor self, int2 location, List actorsAtLocation, bool forceAttack, bool forceQueued, ref string cursor) { if (self.World.Map.IsInMap(location)) { diff --git a/OpenRA.Mods.RA/SupplyTruck.cs b/OpenRA.Mods.RA/SupplyTruck.cs index cec1c97159..e98ba80cd0 100644 --- a/OpenRA.Mods.RA/SupplyTruck.cs +++ b/OpenRA.Mods.RA/SupplyTruck.cs @@ -67,9 +67,9 @@ namespace OpenRA.Mods.RA { } - public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor) + public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceQueued, ref string cursor) { - if (!base.CanTargetActor(self, target, forceAttack, forceMove, forceQueued, ref cursor)) return false; + if (!base.CanTargetActor(self, target, forceAttack, forceQueued, ref cursor)) return false; if (target.AppearsHostileTo(self)) return false; if (!target.HasTrait()) return false;