Merge pull request #4670 from ScottNZ/selection-fix
Fix selection persistence for invisible units
This commit is contained in:
@@ -12,6 +12,7 @@ NEW:
|
|||||||
Engineers can now regain control over husks.
|
Engineers can now regain control over husks.
|
||||||
A player's units, and allied units, now move out of the way when blocking production facilities.
|
A player's units, and allied units, now move out of the way when blocking production facilities.
|
||||||
Added cheat button to grow map resources.
|
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:
|
Dune 2000:
|
||||||
Added the Atreides grenadier from the 1.06 patch.
|
Added the Atreides grenadier from the 1.06 patch.
|
||||||
Added randomized tiles for Sand and Rock terrain.
|
Added randomized tiles for Sand and Rock terrain.
|
||||||
|
|||||||
@@ -56,11 +56,11 @@ namespace OpenRA
|
|||||||
|
|
||||||
public void Tick(World world)
|
public void Tick(World world)
|
||||||
{
|
{
|
||||||
actors.RemoveAll(a => !a.IsInWorld);
|
actors.RemoveAll(a => !a.IsInWorld || world.FogObscures(a));
|
||||||
|
|
||||||
foreach (var cg in controlGroups.Values)
|
foreach (var cg in controlGroups.Values)
|
||||||
cg.RemoveAll(a => a.Destroyed); // note: NOT `!a.IsInWorld`, since that would remove things
|
// note: NOT `!a.IsInWorld`, since that would remove things that are in transports.
|
||||||
// that are in transports.
|
cg.RemoveAll(a => a.Destroyed);
|
||||||
}
|
}
|
||||||
|
|
||||||
Cache<int, List<Actor>> controlGroups = new Cache<int, List<Actor>>(_ => new List<Actor>());
|
Cache<int, List<Actor>> controlGroups = new Cache<int, List<Actor>>(_ => new List<Actor>());
|
||||||
@@ -83,14 +83,15 @@ namespace OpenRA
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var groupActors = controlGroups[group].Where(a => !a.IsDead() && !world.FogObscures(a));
|
||||||
|
|
||||||
if (mods.HasModifier(Modifiers.Alt) || MultiTapCount >= 2)
|
if (mods.HasModifier(Modifiers.Alt) || MultiTapCount >= 2)
|
||||||
{
|
{
|
||||||
worldRenderer.Viewport.Center(controlGroups[group]);
|
worldRenderer.Viewport.Center(groupActors);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Combine(world, controlGroups[group],
|
Combine(world, groupActors, mods.HasModifier(Modifiers.Shift), false);
|
||||||
mods.HasModifier(Modifiers.Shift), false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int? GetControlGroupForActor(Actor a)
|
public int? GetControlGroupForActor(Actor a)
|
||||||
|
|||||||
Reference in New Issue
Block a user