From ac82e1451e4fbb91efa744c6a0e6240a967c9d7c Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 23 Oct 2009 21:31:52 +1300 Subject: [PATCH] Fixes bug #23: enemy units can be ordered --- OpenRa.Game/Actor.cs | 5 ++++- OpenRa.Game/Controller.cs | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/OpenRa.Game/Actor.cs b/OpenRa.Game/Actor.cs index 15ab9a168c..6d68a330ce 100755 --- a/OpenRa.Game/Actor.cs +++ b/OpenRa.Game/Actor.cs @@ -63,7 +63,10 @@ namespace OpenRa.Game } public Order Order( int2 xy ) - { + { + if (Owner != Game.LocalPlayer) + return null; + return traits.WithInterface() .Select( x => x.Order( this, xy ) ) .FirstOrDefault( x => x != null ); diff --git a/OpenRa.Game/Controller.cs b/OpenRa.Game/Controller.cs index ef0b8d2b70..1fb4404fc8 100644 --- a/OpenRa.Game/Controller.cs +++ b/OpenRa.Game/Controller.cs @@ -71,7 +71,9 @@ namespace OpenRa.Game { var uog = orderGenerator as UnitOrderGenerator; - if (uog != null && uog.selection.Count > 0 && uog.selection.Any(a => a.traits.Contains())) + if (uog != null && uog.selection.Count > 0 + && uog.selection.Any(a => a.traits.Contains()) + && uog.selection.All( a => a.Owner == Game.LocalPlayer )) { if (!Game.IsCellBuildable(dragEnd.ToInt2(), UnitMovementType.Wheel)) return Cursor.MoveBlocked; /* todo: handle non-wheel movement behavior */