remove duplication in UOG

This commit is contained in:
Chris Forbes
2012-06-26 11:31:13 +12:00
parent 4373f577d8
commit 220473bf74

View File

@@ -63,9 +63,8 @@ namespace OpenRA.Orders
.Where(o => o != null) .Where(o => o != null)
.ToArray(); .ToArray();
if( orders.Length == 0 ) return (useSelect) ? "select" : "default"; var cursorName = orders.Select(o => o.cursor).FirstOrDefault();
return cursorName ?? (useSelect ? "select" : "default");
return orders[0].cursor ?? ((useSelect) ? "select" : "default");
} }
static UnitOrderResult OrderForUnit(Actor self, CPos xy, MouseInput mi, Actor underCursor) static UnitOrderResult OrderForUnit(Actor self, CPos xy, MouseInput mi, Actor underCursor)