diff --git a/OpenRA.Game/Selection.cs b/OpenRA.Game/Selection.cs index fd08eb1e24..1bd7d26aeb 100644 --- a/OpenRA.Game/Selection.cs +++ b/OpenRA.Game/Selection.cs @@ -61,7 +61,7 @@ namespace OpenRA public void Tick(World world) { - actors.RemoveAll(a => !a.IsInWorld || (a.Owner != world.LocalPlayer && world.FogObscures(a))); + actors.RemoveAll(a => !a.IsInWorld || (!a.Owner.IsAlliedWith(world.LocalPlayer) && world.FogObscures(a))); foreach (var cg in controlGroups.Values) // note: NOT `!a.IsInWorld`, since that would remove things that are in transports. diff --git a/OpenRA.Game/Traits/SelectionDecorations.cs b/OpenRA.Game/Traits/SelectionDecorations.cs index 233624e1d8..1c886071dc 100644 --- a/OpenRA.Game/Traits/SelectionDecorations.cs +++ b/OpenRA.Game/Traits/SelectionDecorations.cs @@ -38,7 +38,7 @@ namespace OpenRA.Traits public IEnumerable RenderAfterWorld(WorldRenderer wr) { - if (self.World.FogObscures(self)) + if (!self.Owner.IsAlliedWith(self.World.RenderPlayer) && self.World.FogObscures(self)) yield break; var b = self.Bounds.Value; @@ -74,9 +74,6 @@ namespace OpenRA.Traits IEnumerable DrawPips(WorldRenderer wr, Actor self, int2 basePosition) { - if (!self.Owner.IsAlliedWith(self.World.RenderPlayer)) - yield break; - var pipSources = self.TraitsImplementing(); if (!pipSources.Any()) yield break; @@ -118,9 +115,6 @@ namespace OpenRA.Traits IEnumerable DrawTags(WorldRenderer wr, Actor self, int2 basePosition) { - if (!self.Owner.IsAlliedWith(self.World.RenderPlayer)) - yield break; - var tagImages = new Animation(self.World, "pips"); var pal = wr.Palette(Info.Palette); var tagxyOffset = new int2(0, 6); diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index b5320243dc..355f459855 100644 --- a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs @@ -239,7 +239,7 @@ namespace OpenRA.Widgets static IEnumerable SelectActorsInBox(World world, int2 a, int2 b, Func cond) { return world.ScreenMap.ActorsInBox(a, b) - .Where(x => x.HasTrait() && x.Trait().Info.Selectable && !world.FogObscures(x) && cond(x)) + .Where(x => x.HasTrait() && x.Trait().Info.Selectable && (x.Owner.IsAlliedWith(world.RenderPlayer) || !world.FogObscures(x)) && cond(x)) .GroupBy(x => x.GetSelectionPriority()) .OrderByDescending(g => g.Key) .Select(g => g.AsEnumerable())