Fix the support power SpeechNotifications not being played to the correct player
This commit is contained in:
@@ -93,18 +93,14 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
base.Activate(self, order, manager);
|
||||
|
||||
if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
|
||||
{
|
||||
Game.Sound.Play(Info.LaunchSound);
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
||||
Info.LaunchSpeechNotification, self.Owner.Faction.InternalName);
|
||||
}
|
||||
else
|
||||
{
|
||||
Game.Sound.Play(Info.IncomingSound);
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
|
||||
Info.IncomingSpeechNotification, self.Owner.Faction.InternalName);
|
||||
}
|
||||
var renderPlayer = self.World.RenderPlayer;
|
||||
var isAllied = self.Owner.IsAlliedWith(renderPlayer);
|
||||
Game.Sound.Play(isAllied ? Info.LaunchSound : Info.IncomingSound);
|
||||
|
||||
// IsAlliedWith returns true if renderPlayer is null, so we are safe here.
|
||||
var toPlayer = isAllied ? renderPlayer ?? self.Owner : renderPlayer;
|
||||
var speech = isAllied ? Info.LaunchSpeechNotification : Info.IncomingSpeechNotification;
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, toPlayer, "Speech", speech, toPlayer.Faction.InternalName);
|
||||
|
||||
if (!string.IsNullOrEmpty(info.ActivationSequence))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user