diff --git a/OpenRA.Game/Selection.cs b/OpenRA.Game/Selection.cs index cc861ca6bf..7c99a6de2f 100644 --- a/OpenRA.Game/Selection.cs +++ b/OpenRA.Game/Selection.cs @@ -42,7 +42,7 @@ namespace OpenRA else actors = (isCombine ? oldSelection.Union(newSelection) : newSelection).ToList(); - var voicedUnit = actors.FirstOrDefault(a => a.Owner == world.LocalPlayer && a.HasVoice()); + var voicedUnit = actors.FirstOrDefault(a => a.Owner == world.LocalPlayer && a.IsInWorld && a.HasVoice()); if (voicedUnit != null) Sound.PlayVoice("Select", voicedUnit, voicedUnit.Owner.Country.Race); @@ -56,6 +56,10 @@ namespace OpenRA public void Tick(World world) { actors.RemoveAll(a => !a.IsInWorld); + + foreach (var cg in controlGroups.Values) + cg.RemoveAll(a => a.Destroyed); // note: NOT `!a.IsInWorld`, since that would remove things + // that are in transports. } Cache> controlGroups = new Cache>(_ => new List());