Fixes bug #23: enemy units can be ordered
This commit is contained in:
@@ -64,6 +64,9 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
public Order Order( int2 xy )
|
public Order Order( int2 xy )
|
||||||
{
|
{
|
||||||
|
if (Owner != Game.LocalPlayer)
|
||||||
|
return null;
|
||||||
|
|
||||||
return traits.WithInterface<Traits.IOrder>()
|
return traits.WithInterface<Traits.IOrder>()
|
||||||
.Select( x => x.Order( this, xy ) )
|
.Select( x => x.Order( this, xy ) )
|
||||||
.FirstOrDefault( x => x != null );
|
.FirstOrDefault( x => x != null );
|
||||||
|
|||||||
@@ -71,7 +71,9 @@ namespace OpenRa.Game
|
|||||||
{
|
{
|
||||||
var uog = orderGenerator as UnitOrderGenerator;
|
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))
|
if (!Game.IsCellBuildable(dragEnd.ToInt2(), UnitMovementType.Wheel))
|
||||||
return Cursor.MoveBlocked; /* todo: handle non-wheel movement behavior */
|
return Cursor.MoveBlocked; /* todo: handle non-wheel movement behavior */
|
||||||
|
|||||||
Reference in New Issue
Block a user