Fix EnemyWatcher's interaction with disguised actors
This commit is contained in:
@@ -69,9 +69,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
foreach (var actor in self.World.ActorsWithTrait<AnnounceOnSeen>())
|
foreach (var actor in self.World.ActorsWithTrait<AnnounceOnSeen>())
|
||||||
{
|
{
|
||||||
// We don't want notifications for allied actors
|
// We don't want notifications for allied actors or actors disguised as such
|
||||||
if ((actor.Actor.EffectiveOwner != null && self.Owner.Stances[actor.Actor.EffectiveOwner.Owner] == Stance.Ally)
|
if (actor.Actor.AppearsFriendlyTo(self))
|
||||||
|| self.Owner.Stances[actor.Actor.Owner] == Stance.Ally)
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (actor.Actor.IsDead || !actor.Actor.IsInWorld)
|
if (actor.Actor.IsDead || !actor.Actor.IsInWorld)
|
||||||
|
|||||||
@@ -45,9 +45,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Hack to disable notifications for neutral actors so some custom maps don't need fixing
|
// Hack to disable notifications for neutral actors so some custom maps don't need fixing
|
||||||
if (!Info.AnnounceNeutrals &&
|
// At this point it's either neutral or an enemy
|
||||||
((self.EffectiveOwner != null && discoverer.Stances[self.EffectiveOwner.Owner] != Stance.Enemy)
|
if (!Info.AnnounceNeutrals && !self.AppearsHostileTo(discoverer.PlayerActor))
|
||||||
|| discoverer.Stances[self.Owner] != Stance.Enemy))
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Audio notification
|
// Audio notification
|
||||||
|
|||||||
Reference in New Issue
Block a user