From 2793d1076a1a452608d0a22eff50c17cb099cc48 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 27 Dec 2011 18:31:20 +1300 Subject: [PATCH] clean up inconsistency in InvisibleToEnemy --- OpenRA.Mods.RA/InvisibleToEnemy.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.RA/InvisibleToEnemy.cs b/OpenRA.Mods.RA/InvisibleToEnemy.cs index bce440b9f0..1988677e3a 100644 --- a/OpenRA.Mods.RA/InvisibleToEnemy.cs +++ b/OpenRA.Mods.RA/InvisibleToEnemy.cs @@ -20,7 +20,8 @@ namespace OpenRA.Mods.RA { public bool IsVisible(Actor self) { - return self.World.LocalPlayer == null || self.Owner == self.World.LocalPlayer; + return self.World.LocalPlayer == null || + self.Owner.Stances[self.World.LocalPlayer] == Stance.Ally; } public Color RadarColorOverride(Actor self) @@ -30,10 +31,10 @@ namespace OpenRA.Mods.RA } static readonly Renderable[] Nothing = { }; + public IEnumerable ModifyRender(Actor self, IEnumerable r) { - return self.World.LocalPlayer == null || self.Owner.Stances[self.World.LocalPlayer] == Stance.Ally - ? r : Nothing; + return IsVisible(self) ? r : Nothing; } } }