dont be detected by friendly detectors

This commit is contained in:
Chris Forbes
2011-03-16 20:48:34 +13:00
parent 8bef8d5a72
commit ff44e34d89

View File

@@ -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<DetectCloaked>().Any(a => (self.Location - a.Actor.Location).Length < a.Actor.Info.Traits.Get<DetectCloakedInfo>().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<DetectCloaked>().Any(a =>
a.Actor.Owner.Stances[self.Owner] != Stance.Ally &&
(self.Location - a.Actor.Location).Length < a.Actor.Info.Traits.Get<DetectCloakedInfo>().Range);
}
public Color RadarColorOverride(Actor self)