Merge pull request #6426 from obrakmann/fix6421

Fix a number or bugs wrt shroud/selection interaction in observer mode
This commit is contained in:
Paul Chote
2014-09-13 08:34:22 +12:00
3 changed files with 3 additions and 3 deletions

View File

@@ -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.

View File

@@ -239,7 +239,7 @@ namespace OpenRA.Widgets
static IEnumerable<Actor> SelectActorsInBox(World world, int2 a, int2 b, Func<Actor, bool> cond)
{
return world.ScreenMap.ActorsInBox(a, b)
.Where(x => x.HasTrait<Selectable>() && x.Trait<Selectable>().Info.Selectable && (x.Owner.IsAlliedWith(world.LocalPlayer) || !world.FogObscures(x)) && cond(x))
.Where(x => x.HasTrait<Selectable>() && x.Trait<Selectable>().Info.Selectable && (x.Owner.IsAlliedWith(world.RenderPlayer) || !world.FogObscures(x)) && cond(x))
.GroupBy(x => x.GetSelectionPriority())
.OrderByDescending(g => g.Key)
.Select(g => g.AsEnumerable())

View File

@@ -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)