Fix multiple notifications in multiplayer bug
This commit is contained in:
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Interval in ticks between scanning for enemies.")]
|
[Desc("Interval in ticks between scanning for enemies.")]
|
||||||
public readonly int ScanInterval = 25;
|
public readonly int ScanInterval = 25;
|
||||||
|
|
||||||
[Desc("Minimal interval in ticks between notifications.")]
|
[Desc("Minimal ticks in-between notifications.")]
|
||||||
public readonly int NotificationInterval = 750;
|
public readonly int NotificationInterval = 750;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new EnemyWatcher(init.Self, this); }
|
public object Create(ActorInitializer init) { return new EnemyWatcher(init.Self, this); }
|
||||||
@@ -89,7 +89,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (playedNotifications.Contains(actor.Trait.Info.Notification))
|
if (playedNotifications.Contains(actor.Trait.Info.Notification))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Announce(self, actor);
|
if (self.Owner == self.World.RenderPlayer)
|
||||||
|
Announce(self, actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (announcedAny)
|
if (announcedAny)
|
||||||
@@ -101,8 +102,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
void Announce(Actor self, TraitPair<AnnounceOnSeen> announce)
|
void Announce(Actor self, TraitPair<AnnounceOnSeen> announce)
|
||||||
{
|
{
|
||||||
// Audio notification
|
// Audio notification
|
||||||
if (self.World.LocalPlayer != null)
|
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", announce.Trait.Info.Notification, self.Owner.Country.Race);
|
||||||
Sound.PlayNotification(self.World.Map.Rules, self.World.LocalPlayer, "Speech", announce.Trait.Info.Notification, self.Owner.Country.Race);
|
|
||||||
|
|
||||||
// Radar notificaion
|
// Radar notificaion
|
||||||
if (announce.Trait.Info.PingRadar && radarPings.Value != null)
|
if (announce.Trait.Info.PingRadar && radarPings.Value != null)
|
||||||
|
|||||||
@@ -93,7 +93,9 @@ namespace OpenRA.Mods.D2k.Activities
|
|||||||
void NotifyPlayer(Player player, WPos location)
|
void NotifyPlayer(Player player, WPos location)
|
||||||
{
|
{
|
||||||
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", swallow.Info.WormAttackNotification, player.Country.Race);
|
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", swallow.Info.WormAttackNotification, player.Country.Race);
|
||||||
radarPings.Add(() => true, location, Color.Red, 50);
|
|
||||||
|
if (player == player.World.RenderPlayer)
|
||||||
|
radarPings.Add(() => true, location, Color.Red, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override Activity Tick(Actor self)
|
public override Activity Tick(Actor self)
|
||||||
|
|||||||
Reference in New Issue
Block a user