diff --git a/OpenRA.Mods.Common/Traits/Sound/AnnounceOnSeen.cs b/OpenRA.Mods.Common/Traits/Sound/AnnounceOnSeen.cs index 51a0fa8c7e..09eff580ec 100644 --- a/OpenRA.Mods.Common/Traits/Sound/AnnounceOnSeen.cs +++ b/OpenRA.Mods.Common/Traits/Sound/AnnounceOnSeen.cs @@ -22,6 +22,8 @@ namespace OpenRA.Mods.Common.Traits public readonly string Notification = null; + public readonly bool AnnounceNeutrals = false; + public object Create(ActorInitializer init) { return new AnnounceOnSeen(init.Self, this); } } @@ -42,6 +44,12 @@ namespace OpenRA.Mods.Common.Traits if (!playNotification || discoverer != self.World.RenderPlayer) return; + // Hack to disable notifications for neutral actors so some custom maps don't need fixing + if (!Info.AnnounceNeutrals && + ((self.EffectiveOwner != null && discoverer.Stances[self.EffectiveOwner.Owner] != Stance.Enemy) + || discoverer.Stances[self.Owner] != Stance.Enemy)) + return; + // Audio notification if (discoverer != null && !string.IsNullOrEmpty(Info.Notification)) Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Country.Race);