From eff54a614b3ef3ee73963dec9dd958eaa38aaa76 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Sun, 7 Sep 2014 00:52:55 +0200 Subject: [PATCH 1/3] Fix selection glitch in observer mode Fixes #6421. --- OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index 953f6fcc53..76d19c87e3 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 && (x.Owner.IsAlliedWith(world.LocalPlayer) || !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()) From bc50e1b0e2385d25947b2433853f49ebb6a0c5dc Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Sun, 7 Sep 2014 00:55:23 +0200 Subject: [PATCH 2/3] Reset selection when switching player shroud in observer mode The selection will be reset when switching from any shroud view to a player shroud view. The selection will be kept when switching from any view to either 'All players' or 'Shroud disabled' view. --- OpenRA.Mods.RA/Widgets/Logic/ObserverShroudSelectorLogic.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Widgets/Logic/ObserverShroudSelectorLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ObserverShroudSelectorLogic.cs index 21f04be254..ebe69cc28b 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ObserverShroudSelectorLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ObserverShroudSelectorLogic.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic Color = p.Color.RGB; Race = p.Country.Race; IsSelected = () => p.World.RenderPlayer == p; - OnClick = () => { p.World.RenderPlayer = p; logic.selected = this; }; + OnClick = () => { p.World.RenderPlayer = p; logic.selected = this; p.World.Selection.Clear(); }; } public CameraOption(ObserverShroudSelectorLogic logic, World w, string label, Player p) From 44582ae647c600c7af3bd8c2a5dc13e26174aa3e Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Sun, 7 Sep 2014 01:10:52 +0200 Subject: [PATCH 3/3] Fix another shroud/selection bug in observer mode In a player view, enemy units would not be unselected when they entered the shroud. --- OpenRA.Game/Selection.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Selection.cs b/OpenRA.Game/Selection.cs index 28f3359905..c40f284d82 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.IsAlliedWith(world.LocalPlayer) && world.FogObscures(a))); + actors.RemoveAll(a => !a.IsInWorld || (!a.Owner.IsAlliedWith(world.RenderPlayer) && world.FogObscures(a))); foreach (var cg in controlGroups.Values) // note: NOT `!a.IsInWorld`, since that would remove things that are in transports.