From 18fe8e93fa2e873e58b4e4802852c180727fc3db Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Mon, 17 Feb 2014 03:39:14 +1300 Subject: [PATCH 1/2] Fix unit selection persisting/control groups working when the unit isn't visible --- OpenRA.Game/Selection.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/OpenRA.Game/Selection.cs b/OpenRA.Game/Selection.cs index c25b237104..7e59fc9753 100644 --- a/OpenRA.Game/Selection.cs +++ b/OpenRA.Game/Selection.cs @@ -56,11 +56,11 @@ namespace OpenRA public void Tick(World world) { - actors.RemoveAll(a => !a.IsInWorld); + actors.RemoveAll(a => !a.IsInWorld || world.FogObscures(a)); foreach (var cg in controlGroups.Values) - cg.RemoveAll(a => a.Destroyed); // note: NOT `!a.IsInWorld`, since that would remove things - // that are in transports. + // note: NOT `!a.IsInWorld`, since that would remove things that are in transports. + cg.RemoveAll(a => a.Destroyed); } Cache> controlGroups = new Cache>(_ => new List()); @@ -83,14 +83,15 @@ namespace OpenRA return; } + var groupActors = controlGroups[group].Where(a => !a.IsDead() && !world.FogObscures(a)); + if (mods.HasModifier(Modifiers.Alt) || MultiTapCount >= 2) { - worldRenderer.Viewport.Center(controlGroups[group]); + worldRenderer.Viewport.Center(groupActors); return; } - Combine(world, controlGroups[group], - mods.HasModifier(Modifiers.Shift), false); + Combine(world, groupActors, mods.HasModifier(Modifiers.Shift), false); } public int? GetControlGroupForActor(Actor a) From 38c1a68be64ecc1af566e3a5a2a96d0b457bdfe8 Mon Sep 17 00:00:00 2001 From: ScottNZ Date: Mon, 17 Feb 2014 03:52:57 +1300 Subject: [PATCH 2/2] Update CHANGELOG for selection changes --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 96ec13e9d9..9209974569 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -12,6 +12,7 @@ NEW: Engineers can now regain control over husks. A player's units, and allied units, now move out of the way when blocking production facilities. Added cheat button to grow map resources. + Fixed units staying selected and contributing to control groups when becoming cloaked or hidden in fog. Dune 2000: Added the Atreides grenadier from the 1.06 patch. Added randomized tiles for Sand and Rock terrain.