diff --git a/OpenRA.Game/Network/Order.cs b/OpenRA.Game/Network/Order.cs index cca62d338a..da11dc4f76 100755 --- a/OpenRA.Game/Network/Order.cs +++ b/OpenRA.Game/Network/Order.cs @@ -60,8 +60,6 @@ namespace OpenRA public Order(string orderString, Actor subject, bool queued) : this(orderString, subject, null, int2.Zero, null, queued, int2.Zero) { } - public Order(string orderString, Actor subject, int2 targetLocation, bool queued) - : this(orderString, subject, null, targetLocation, null, queued, int2.Zero) { } public Order(string orderString, Actor subject, string targetString, bool queued) : this(orderString, subject, null, int2.Zero, targetString, queued, int2.Zero) { } public Order(string orderString, Actor subject, Actor targetActor, int2 targetLocation, bool queued) diff --git a/OpenRA.Game/Orders/GenericSelectTarget.cs b/OpenRA.Game/Orders/GenericSelectTarget.cs index 39c6c77beb..15af275790 100644 --- a/OpenRA.Game/Orders/GenericSelectTarget.cs +++ b/OpenRA.Game/Orders/GenericSelectTarget.cs @@ -61,7 +61,7 @@ namespace OpenRA.Orders { world.CancelInputMode(); foreach (var subject in subjects) - yield return new Order(order, subject, xy, false); + yield return new Order(order, subject, false) { TargetLocation = xy }; } } diff --git a/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs b/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs index 1b8cb7ff5b..0046df8b7e 100644 --- a/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs +++ b/OpenRA.Game/Widgets/Delegates/DiplomacyDelegate.cs @@ -139,7 +139,7 @@ namespace OpenRA.Widgets.Delegates var nextStance = GetNextStance((Stance)Enum.Parse(typeof(Stance), bw.Text)); world.IssueOrder(new Order("SetStance", world.LocalPlayer.PlayerActor, - new int2(p.Index, (int)nextStance), false)); + false) { TargetLocation = new int2(p.Index, (int)nextStance) }); bw.Text = nextStance.ToString(); } diff --git a/OpenRA.Mods.RA/Air/Helicopter.cs b/OpenRA.Mods.RA/Air/Helicopter.cs index 5145ea0650..0367bed786 100755 --- a/OpenRA.Mods.RA/Air/Helicopter.cs +++ b/OpenRA.Mods.RA/Air/Helicopter.cs @@ -57,7 +57,7 @@ namespace OpenRA.Mods.RA.Air return new Order(order.OrderID, self, queued) { TargetActor = target.Actor }; if( order.OrderID == "Move" ) - return new Order( order.OrderID, self, Util.CellContaining( target.CenterLocation ), queued ); + return new Order(order.OrderID, self, queued) { TargetLocation = Util.CellContaining(target.CenterLocation) }; return null; } diff --git a/OpenRA.Mods.RA/Air/Plane.cs b/OpenRA.Mods.RA/Air/Plane.cs index 82517d076b..3e3c3315b3 100755 --- a/OpenRA.Mods.RA/Air/Plane.cs +++ b/OpenRA.Mods.RA/Air/Plane.cs @@ -66,7 +66,7 @@ namespace OpenRA.Mods.RA.Air return new Order(order.OrderID, self, queued) { TargetActor = target.Actor }; if( order.OrderID == "Move" ) - return new Order( order.OrderID, self, Util.CellContaining( target.CenterLocation ), queued ); + return new Order( order.OrderID, self, queued ) { TargetLocation = Util.CellContaining( target.CenterLocation ) }; return null; } diff --git a/OpenRA.Mods.RA/AttackBase.cs b/OpenRA.Mods.RA/AttackBase.cs index 5bc51c2f70..70a95c78d0 100644 --- a/OpenRA.Mods.RA/AttackBase.cs +++ b/OpenRA.Mods.RA/AttackBase.cs @@ -140,7 +140,7 @@ namespace OpenRA.Mods.RA if( target.IsActor ) return new Order("Attack", self, queued) { TargetActor = target.Actor }; else - return new Order( "Attack", self, Util.CellContaining( target.CenterLocation ), queued ); + return new Order( "Attack", self, queued ) { TargetLocation = Util.CellContaining( target.CenterLocation ) }; } return null; } diff --git a/OpenRA.Mods.RA/HackyAI.cs b/OpenRA.Mods.RA/HackyAI.cs index d22c23d579..edab77cf56 100644 --- a/OpenRA.Mods.RA/HackyAI.cs +++ b/OpenRA.Mods.RA/HackyAI.cs @@ -302,7 +302,7 @@ namespace OpenRA.Mods.RA int2 newRallyPoint = ChooseRallyLocationNear(a.Location); newRallyPoint.X += 4; newRallyPoint.Y += 4; - world.IssueOrder(new Order("SetRallyPoint", a, newRallyPoint, false)); + world.IssueOrder(new Order("SetRallyPoint", a, false) { TargetLocation = newRallyPoint }); } } @@ -335,7 +335,7 @@ namespace OpenRA.Mods.RA range = Math.Max(range, loopCount / 2); if (loopCount > 10) return false; } while (!a.Trait().CanEnterCell(xy) && xy != a.Location); - world.IssueOrder(new Order("Move", a, xy, false)); + world.IssueOrder(new Order("Move", a, false) { TargetLocation = xy }); return true; } @@ -357,7 +357,7 @@ namespace OpenRA.Mods.RA range = Math.Max(range, loopCount / 2); if (loopCount > 10) return false; } while (!a.Trait().CanEnterCell(xy) && xy != a.Location); - world.IssueOrder(new Order("AttackMove", a, xy, false)); + world.IssueOrder(new Order("AttackMove", a, false) { TargetLocation = xy }); return true; } diff --git a/OpenRA.Mods.RA/Harvester.cs b/OpenRA.Mods.RA/Harvester.cs index 5c2a8e7c45..ab0d776844 100644 --- a/OpenRA.Mods.RA/Harvester.cs +++ b/OpenRA.Mods.RA/Harvester.cs @@ -109,7 +109,7 @@ namespace OpenRA.Mods.RA return new Order(order.OrderID, self, queued) { TargetActor = target.Actor }; if( order.OrderID == "Harvest" ) - return new Order( order.OrderID, self, Util.CellContaining( target.CenterLocation ), queued ); + return new Order(order.OrderID, self, queued) { TargetLocation = Util.CellContaining(target.CenterLocation) }; return null; } diff --git a/OpenRA.Mods.RA/Minelayer.cs b/OpenRA.Mods.RA/Minelayer.cs index f2bc2d51c7..d90cf640e2 100644 --- a/OpenRA.Mods.RA/Minelayer.cs +++ b/OpenRA.Mods.RA/Minelayer.cs @@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA { var start = Traits.Util.CellContaining( target.CenterLocation ); self.World.OrderGenerator = new MinefieldOrderGenerator( self, start ); - return new Order( "BeginMinefield", self, start, false ); + return new Order("BeginMinefield", self, false) { TargetLocation = start }; } return null; } @@ -110,7 +110,7 @@ namespace OpenRA.Mods.RA if( mi.Button == MouseButton.Right && underCursor == null ) { minelayer.World.CancelInputMode(); - yield return new Order( "PlaceMinefield", minelayer, xy, false ); + yield return new Order("PlaceMinefield", minelayer, false) { TargetLocation = xy }; } } @@ -127,7 +127,8 @@ namespace OpenRA.Mods.RA return; var movement = minelayer.Trait(); - var minefield = GetMinefieldCells(minefieldStart, lastMousePos, minelayer.Info.Traits.Get().MinefieldDepth) + var minefield = GetMinefieldCells(minefieldStart, lastMousePos, + minelayer.Info.Traits.Get().MinefieldDepth) .Where(p => movement.CanEnterCell(p)).ToArray(); wr.DrawLocus(Color.Cyan, minefield); diff --git a/OpenRA.Mods.RA/Move/Mobile.cs b/OpenRA.Mods.RA/Move/Mobile.cs index d6649ddefb..eaac8b181c 100755 --- a/OpenRA.Mods.RA/Move/Mobile.cs +++ b/OpenRA.Mods.RA/Move/Mobile.cs @@ -146,7 +146,7 @@ namespace OpenRA.Mods.RA.Move if( order is MoveOrderTargeter ) { if( Info.OnRails ) return null; - return new Order( "Move", self, Util.CellContaining( target.CenterLocation ), queued ); + return new Order( "Move", self, queued ) { TargetLocation = Util.CellContaining( target.CenterLocation ) }; } return null; } diff --git a/OpenRA.Mods.RA/Orders/SetChronoTankDestination.cs b/OpenRA.Mods.RA/Orders/SetChronoTankDestination.cs index 88e3521b2f..c2c269a9ba 100644 --- a/OpenRA.Mods.RA/Orders/SetChronoTankDestination.cs +++ b/OpenRA.Mods.RA/Orders/SetChronoTankDestination.cs @@ -32,8 +32,9 @@ namespace OpenRA.Mods.RA.Orders yield break; } + var queued = mi.Modifiers.HasModifier(Modifiers.Shift); if (world.LocalPlayer.Shroud.IsExplored(xy)) - yield return new Order("ChronoshiftSelf", self, xy, mi.Modifiers.HasModifier(Modifiers.Shift)); + yield return new Order("ChronoshiftSelf", self, queued) { TargetLocation = xy }; } public void Tick( World world ) { } diff --git a/OpenRA.Mods.RA/RallyPoint.cs b/OpenRA.Mods.RA/RallyPoint.cs index be3ecc5212..ee8478692e 100755 --- a/OpenRA.Mods.RA/RallyPoint.cs +++ b/OpenRA.Mods.RA/RallyPoint.cs @@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA public Order IssueOrder( Actor self, IOrderTargeter order, Target target, bool queued ) { if( order.OrderID == "SetRallyPoint" ) - return new Order( order.OrderID, self, Traits.Util.CellContaining( target.CenterLocation ), false ); + return new Order(order.OrderID, self, false) { TargetLocation = Traits.Util.CellContaining(target.CenterLocation) }; return null; }