From 0cd140849b357cd43ff20ad81a000e964c8902e4 Mon Sep 17 00:00:00 2001 From: Bob Date: Sat, 2 Oct 2010 14:57:17 +1200 Subject: [PATCH] fix some support powers --- OpenRA.Game/Orders/GenericSelectTarget.cs | 7 +++++-- OpenRA.Mods.Cnc/IonCannonPower.cs | 3 --- OpenRA.Mods.RA/Minelayer.cs | 6 +++--- OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs | 3 --- OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs | 3 --- OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs | 3 --- OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs | 3 --- OpenRA.Mods.RA/SupportPowers/NukePower.cs | 1 - OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs | 3 --- OpenRA.Mods.RA/SupportPowers/SpyPlanePower.cs | 3 --- 10 files changed, 8 insertions(+), 27 deletions(-) diff --git a/OpenRA.Game/Orders/GenericSelectTarget.cs b/OpenRA.Game/Orders/GenericSelectTarget.cs index 2003a11604..d684a11817 100644 --- a/OpenRA.Game/Orders/GenericSelectTarget.cs +++ b/OpenRA.Game/Orders/GenericSelectTarget.cs @@ -35,8 +35,11 @@ namespace OpenRA.Orders IEnumerable OrderInner(World world, int2 xy, MouseInput mi) { - if (mi.Button == MouseButton.Left && world.Map.IsInMap(xy)) - yield return new Order(order, subject, xy); + if( mi.Button == MouseButton.Left && world.Map.IsInMap( xy ) ) + { + world.CancelInputMode(); + yield return new Order( order, subject, xy ); + } } public virtual void Tick(World world) { } diff --git a/OpenRA.Mods.Cnc/IonCannonPower.cs b/OpenRA.Mods.Cnc/IonCannonPower.cs index ccd8f97230..a0c487c40a 100644 --- a/OpenRA.Mods.Cnc/IonCannonPower.cs +++ b/OpenRA.Mods.Cnc/IonCannonPower.cs @@ -34,9 +34,6 @@ namespace OpenRA.Mods.Cnc w.Add(new IonCannon(self, w, order.TargetLocation)); }); - if (Owner == Owner.World.LocalPlayer) - self.World.CancelInputMode(); - FinishActivate(); } } diff --git a/OpenRA.Mods.RA/Minelayer.cs b/OpenRA.Mods.RA/Minelayer.cs index 5aba5e273e..a079142d52 100644 --- a/OpenRA.Mods.RA/Minelayer.cs +++ b/OpenRA.Mods.RA/Minelayer.cs @@ -54,9 +54,9 @@ namespace OpenRA.Mods.RA { if (order.OrderString == "BeginMinefield") { - minefieldStart = order.TargetLocation; - if (self.Owner == self.World.LocalPlayer) - self.World.OrderGenerator = new MinefieldOrderGenerator(self); + //minefieldStart = order.TargetLocation; + //if (self.Owner == self.World.LocalPlayer) + // self.World.OrderGenerator = new MinefieldOrderGenerator(self); } if (order.OrderString == "PlaceMinefield") diff --git a/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs b/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs index 876584aed0..be73f53a84 100755 --- a/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs +++ b/OpenRA.Mods.RA/Orders/PlaceBuildingOrderGenerator.cs @@ -63,9 +63,6 @@ namespace OpenRA.Mods.RA.Orders p.CurrentItem().Item == Building && p.CurrentItem().RemainingTime == 0) .FirstOrDefault(); - - if (queue == null) - world.CancelInputMode(); } public void RenderAfterWorld( World world ) {} diff --git a/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs b/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs index ed9604bc11..b38fbf2e08 100755 --- a/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs @@ -71,9 +71,6 @@ namespace OpenRA.Mods.RA a.QueueActivity(new RemoveSelf()); }); - if (Owner == Owner.World.LocalPlayer) - self.World.CancelInputMode(); - FinishActivate(); } } diff --git a/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs b/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs index f99af11dea..edcf89a1b6 100755 --- a/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/ChronoshiftPower.cs @@ -37,9 +37,6 @@ namespace OpenRA.Mods.RA if (order.OrderString == "ChronosphereActivate") { - if (self.Owner == self.World.LocalPlayer) - self.World.CancelInputMode(); - // Ensure the target cell is valid for the unit var movement = order.TargetActor.TraitOrDefault(); if (!movement.CanEnterCell(order.TargetLocation)) diff --git a/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs b/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs index 5e04cc44ff..b8f4fe4b47 100755 --- a/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/IronCurtainPower.cs @@ -39,9 +39,6 @@ namespace OpenRA.Mods.RA if (order.OrderString == "IronCurtain") { - if (self.Owner == self.World.LocalPlayer) - self.World.CancelInputMode(); - var curtain = self.World.Queries.WithTrait() .Where(a => a.Actor.Owner != null) .FirstOrDefault().Actor; diff --git a/OpenRA.Mods.RA/SupportPowers/NukePower.cs b/OpenRA.Mods.RA/SupportPowers/NukePower.cs index 197e64eab1..2263afa70a 100755 --- a/OpenRA.Mods.RA/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/NukePower.cs @@ -49,7 +49,6 @@ namespace OpenRA.Mods.RA silo.Trait().Attack(order.TargetLocation); - self.World.CancelInputMode(); FinishActivate(); } } diff --git a/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs b/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs index 75707bf947..59320fe648 100755 --- a/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs @@ -43,9 +43,6 @@ namespace OpenRA.Mods.RA if (order.OrderString == "ParatroopersActivate") { - if (self.Owner == self.World.LocalPlayer) - self.World.CancelInputMode(); - DoParadrop(Owner, order.TargetLocation, self.Info.Traits.Get().DropItems); diff --git a/OpenRA.Mods.RA/SupportPowers/SpyPlanePower.cs b/OpenRA.Mods.RA/SupportPowers/SpyPlanePower.cs index 2917b1027a..96cf322654 100755 --- a/OpenRA.Mods.RA/SupportPowers/SpyPlanePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/SpyPlanePower.cs @@ -41,9 +41,6 @@ namespace OpenRA.Mods.RA { FinishActivate(); - if (order.Player == Owner.World.LocalPlayer) - self.World.CancelInputMode(); - var enterCell = self.World.ChooseRandomEdgeCell(); var plane = self.World.CreateActor("u2", new TypeDictionary