DetectCloaked: actor should be in world
This commit is contained in:
@@ -261,8 +261,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!Cloaked || self.Owner.IsAlliedWith(viewer))
|
if (!Cloaked || self.Owner.IsAlliedWith(viewer))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return self.World.ActorsWithTrait<DetectCloaked>().Any(a => a.Actor.Owner.IsAlliedWith(viewer)
|
return self.World.ActorsWithTrait<DetectCloaked>().Any(a => a.Actor.IsInWorld
|
||||||
&& Info.DetectionTypes.Overlaps(a.Trait.Info.DetectionTypes)
|
&& a.Actor.Owner.IsAlliedWith(viewer) && Info.DetectionTypes.Overlaps(a.Trait.Info.DetectionTypes)
|
||||||
&& (self.CenterPosition - a.Actor.CenterPosition).LengthSquared <= a.Trait.Range.LengthSquared);
|
&& (self.CenterPosition - a.Actor.CenterPosition).LengthSquared <= a.Trait.Range.LengthSquared);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user