From 98e64fc4466a5c038bbd8ca5489edf9586ee0b72 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 1 Nov 2009 19:57:03 +1300 Subject: [PATCH] fixes #72 --- OpenRa.Game/Order.cs | 5 +++-- OpenRa.Game/Traits/Mobile.cs | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/OpenRa.Game/Order.cs b/OpenRa.Game/Order.cs index 5b99845060..6df223b866 100644 --- a/OpenRa.Game/Order.cs +++ b/OpenRa.Game/Order.cs @@ -92,9 +92,10 @@ namespace OpenRa.Game return new Order(subject.Owner, "Attack", subject, target, int2.Zero, null, Cursor.Attack); } - public static Order Move(Actor subject, int2 target) + public static Order Move(Actor subject, int2 target, bool isBlocked) { - return new Order(subject.Owner, "Move", subject, null, target, null, Cursor.Move); + return new Order(subject.Owner, "Move", subject, null, target, null, + isBlocked ? Cursor.MoveBlocked : Cursor.Move); } public static Order DeployMcv(Actor subject) diff --git a/OpenRa.Game/Traits/Mobile.cs b/OpenRa.Game/Traits/Mobile.cs index fa15ebcf74..dd72568cc5 100644 --- a/OpenRa.Game/Traits/Mobile.cs +++ b/OpenRa.Game/Traits/Mobile.cs @@ -53,12 +53,12 @@ namespace OpenRa.Game.Traits if( lmb ) return null; if( underCursor != null ) - return null; + return null; + + if (xy == toCell) return null; - if( xy != toCell ) - return OpenRa.Game.Order.Move( self, xy ); - - return null; + return OpenRa.Game.Order.Move( self, xy, + !Game.IsCellBuildable(xy, GetMovementType()) ); } public void Cancel(Actor self)