diff --git a/OpenRa.Game/Controller.cs b/OpenRa.Game/Controller.cs index 661c0ec1f4..cc6bef5aca 100644 --- a/OpenRa.Game/Controller.cs +++ b/OpenRa.Game/Controller.cs @@ -4,7 +4,8 @@ using System.Linq; using System.Text; using System.Windows.Forms; using IjwFramework.Types; -using System.Drawing; +using System.Drawing; +using OpenRa.Game.Traits; namespace OpenRa.Game { @@ -77,9 +78,14 @@ namespace OpenRa.Game 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 */ + { + var umts = uog.selection.Select(a => a.traits.GetOrDefault()) + .Where(m => m != null) + .Select(m => m.GetMovementType()) + .Distinct(); + + if (!umts.Any( umt => Game.IsCellBuildable( dragEnd.ToInt2(), umt ) )) + return Cursor.MoveBlocked; return Cursor.Move; }