From 06f530b562d1a720b28f5d2b51841d0aef41b1c8 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 5 May 2010 22:05:47 +1200 Subject: [PATCH] choose under-cursor actor by priority --- OpenRA.Game/Actor.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/Actor.cs b/OpenRA.Game/Actor.cs index 3a7a67a370..215b435f51 100755 --- a/OpenRA.Game/Actor.cs +++ b/OpenRA.Game/Actor.cs @@ -125,7 +125,9 @@ namespace OpenRA return null; var underCursor = World.FindUnitsAtMouse(mi.Location) - .FirstOrDefault(a => a.traits.Contains()); + .Where(a => a.Info.Traits.Contains()) + .OrderByDescending(a => a.Info.Traits.Get().Priority) + .FirstOrDefault(); return traits.WithInterface() .Select( x => x.IssueOrder( this, xy, mi, underCursor ) )