From 10a1f7ec1eeab59bc4bacf5596186077c97832b8 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 13 Sep 2010 03:28:00 +1200 Subject: [PATCH] Fix #65; allow aircraft to receive move orders over buildings --- OpenRA.Mods.RA/Helicopter.cs | 9 ++++----- OpenRA.Mods.RA/Plane.cs | 10 +++------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/OpenRA.Mods.RA/Helicopter.cs b/OpenRA.Mods.RA/Helicopter.cs index c3b7a6f6be..18dfff345a 100644 --- a/OpenRA.Mods.RA/Helicopter.cs +++ b/OpenRA.Mods.RA/Helicopter.cs @@ -49,14 +49,13 @@ namespace OpenRA.Mods.RA { if (mi.Button == MouseButton.Left) return null; - if (underCursor == null) - if (self.TraitOrDefault().CanEnterCell(xy)) - return new Order("Move", self, xy); - - if (AircraftCanEnter(self, underCursor) + if (underCursor != null && AircraftCanEnter(self, underCursor) && underCursor.Owner == self.Owner) return new Order("Enter", self, underCursor); + if (self.TraitOrDefault().CanEnterCell(xy)) + return new Order("Move", self, xy); + return null; } diff --git a/OpenRA.Mods.RA/Plane.cs b/OpenRA.Mods.RA/Plane.cs index 771a55c207..e928f145aa 100644 --- a/OpenRA.Mods.RA/Plane.cs +++ b/OpenRA.Mods.RA/Plane.cs @@ -55,15 +55,11 @@ namespace OpenRA.Mods.RA public Order IssueOrder(Actor self, int2 xy, MouseInput mi, Actor underCursor) { if (mi.Button == MouseButton.Left) return null; - - if (underCursor == null) - return new Order("Move", self, xy); - - if (AircraftCanEnter(self, underCursor) + if (underCursor != null && AircraftCanEnter(self, underCursor) && underCursor.Owner == self.Owner) return new Order("Enter", self, underCursor); - - return null; + + return new Order("Move", self, xy); } public string CursorForOrder(Actor self, Order order)