Tweak visibility; hopefully allows targeting of detected units

This commit is contained in:
Paul Chote
2010-08-15 05:43:00 +12:00
parent 7f191887ec
commit 230d59f655
8 changed files with 15 additions and 15 deletions

View File

@@ -174,7 +174,7 @@ namespace OpenRA.Widgets
IEnumerable<Actor> SelectActorsInBox(World world, float2 a, float2 b)
{
return world.FindUnits(a, b)
.Where( x => x.HasTrait<Selectable>() && x.IsVisible() )
.Where( x => x.HasTrait<Selectable>() && x.IsVisible(world.LocalPlayer) )
.GroupBy(x => (x.Owner == world.LocalPlayer) ? x.Info.Traits.Get<SelectableInfo>().Priority : 0)
.OrderByDescending(g => g.Key)
.Select( g => g.AsEnumerable() )