From ff44e34d894847d1dbfde444de676eabaabcfd79 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Wed, 16 Mar 2011 20:48:34 +1300 Subject: [PATCH] dont be detected by friendly detectors --- OpenRA.Mods.RA/Cloak.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.RA/Cloak.cs b/OpenRA.Mods.RA/Cloak.cs index 164ed785d0..6e3f7e385b 100644 --- a/OpenRA.Mods.RA/Cloak.cs +++ b/OpenRA.Mods.RA/Cloak.cs @@ -104,10 +104,14 @@ namespace OpenRA.Mods.RA public bool IsVisible(Actor self) { - if (!Cloaked || self.Owner == self.World.LocalPlayer || self.World.LocalPlayer == null || self.Owner.Stances[self.World.LocalPlayer] == Stance.Ally) - return true; - - return self.World.Queries.WithTrait().Any(a => (self.Location - a.Actor.Location).Length < a.Actor.Info.Traits.Get().Range); + if (!Cloaked || self.Owner == self.World.LocalPlayer || + self.World.LocalPlayer == null || + self.Owner.Stances[self.World.LocalPlayer] == Stance.Ally) + return true; + + return self.World.Queries.WithTrait().Any(a => + a.Actor.Owner.Stances[self.Owner] != Stance.Ally && + (self.Location - a.Actor.Location).Length < a.Actor.Info.Traits.Get().Range); } public Color RadarColorOverride(Actor self)