ChooseCursor sanity

This commit is contained in:
Chris Forbes
2009-12-02 19:22:15 +13:00
parent fb7f1f2817
commit 074ab5675e

View File

@@ -47,10 +47,6 @@ namespace OpenRa.Game
recentOrders.RemoveAll(o => !o.IsImmediate);
return result;
}
//var ret = recentOrders;
//recentOrders = new List<Order>();
//return ret;
}
static string GetVoiceSuffix(Actor unit)
@@ -120,7 +116,8 @@ namespace OpenRa.Game
public Cursor ChooseCursor()
{
var c = (orderGenerator is UnitOrderGenerator) ? orderGenerator.Order(dragEnd.ToInt2(), false)
.Select(a => CursorForOrderString( a.OrderString, a.Subject, a.TargetLocation ))
.Where( o => o.Validate() )
.Select(o => CursorForOrderString( o.OrderString, o.Subject, o.TargetLocation ))
.FirstOrDefault(a => a != null) : null;
return c ?? (Game.SelectActorsInBox(Game.CellSize * dragEnd, Game.CellSize * dragEnd).Any() ? Cursor.Select : Cursor.Default);