From 618ba6342cf574cf7b6ec2b31a155f781e9d76c8 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Sun, 26 Jul 2015 21:46:27 +0200 Subject: [PATCH 1/2] Fix not being able to select enemy units --- OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs b/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs index ce4a3dea52..2f603ede9c 100644 --- a/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs +++ b/OpenRA.Mods.Common/Traits/Render/SelectionDecorations.cs @@ -71,7 +71,7 @@ namespace OpenRA.Mods.Common.Traits public IEnumerable RenderAfterWorld(WorldRenderer wr) { - if (!self.Owner.IsAlliedWith(self.World.RenderPlayer) || self.World.FogObscures(self)) + if (self.World.FogObscures(self)) yield break; if (Info.RenderSelectionBox) @@ -80,6 +80,9 @@ namespace OpenRA.Mods.Common.Traits if (Info.RenderSelectionBars) yield return new SelectionBarsRenderable(self); + if (!self.Owner.IsAlliedWith(wr.World.RenderPlayer)) + yield break; + if (self.World.LocalPlayer != null && self.World.LocalPlayer.PlayerActor.Trait().PathDebug) yield return new TargetLineRenderable(ActivityTargetPath(), Color.Green); From a2a0059f7f9eeb3981718ac3d6b83a504ac2d3f0 Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Mon, 27 Jul 2015 13:07:16 +0200 Subject: [PATCH 2/2] Fix chronoshift duration being visible to enemy players --- OpenRA.Mods.RA/Traits/Chronoshiftable.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Traits/Chronoshiftable.cs b/OpenRA.Mods.RA/Traits/Chronoshiftable.cs index 82b0ddc097..68f7d33973 100644 --- a/OpenRA.Mods.RA/Traits/Chronoshiftable.cs +++ b/OpenRA.Mods.RA/Traits/Chronoshiftable.cs @@ -26,6 +26,7 @@ namespace OpenRA.Mods.RA.Traits public class Chronoshiftable : ITick, ISync, ISelectionBar { readonly ChronoshiftableInfo info; + readonly Actor self; Actor chronosphere; bool killCargo; int duration; @@ -37,6 +38,7 @@ namespace OpenRA.Mods.RA.Traits public Chronoshiftable(ActorInitializer init, ChronoshiftableInfo info) { this.info = info; + self = init.Self; if (init.Contains()) ReturnTicks = init.Get(); @@ -96,7 +98,8 @@ namespace OpenRA.Mods.RA.Traits // Show the remaining time as a bar public float GetValue() { - if (ReturnTicks == 0) // otherwise an empty bar is rendered all the time + // otherwise an empty bar is rendered all the time + if (ReturnTicks == 0 || !self.Owner.IsAlliedWith(self.World.RenderPlayer)) return 0f; return (float)ReturnTicks / duration;