Fixes bug #23: enemy units can be ordered

This commit is contained in:
Chris Forbes
2009-10-23 21:31:52 +13:00
parent dd8c70d3c2
commit ac82e1451e
2 changed files with 7 additions and 2 deletions

View File

@@ -64,6 +64,9 @@ namespace OpenRa.Game
public Order Order( int2 xy )
{
if (Owner != Game.LocalPlayer)
return null;
return traits.WithInterface<Traits.IOrder>()
.Select( x => x.Order( this, xy ) )
.FirstOrDefault( x => x != null );

View File

@@ -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<Traits.Mobile>()))
if (uog != null && uog.selection.Count > 0
&& uog.selection.Any(a => a.traits.Contains<Traits.Mobile>())
&& uog.selection.All( a => a.Owner == Game.LocalPlayer ))
{
if (!Game.IsCellBuildable(dragEnd.ToInt2(), UnitMovementType.Wheel))
return Cursor.MoveBlocked; /* todo: handle non-wheel movement behavior */