From e54b88a6cbbd6ea573f6561db3d495580b5ac445 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Tue, 15 Nov 2022 23:33:30 +0100 Subject: [PATCH] Remove dead code inside SupportPower.cs --- OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs index 2be8f1f047..ebe0fea647 100644 --- a/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs +++ b/OpenRA.Mods.Common/Traits/SupportPowers/SupportPower.cs @@ -219,18 +219,16 @@ namespace OpenRA.Mods.Common.Traits public virtual void PlayLaunchSounds() { var localPlayer = Self.World.LocalPlayer; - if (localPlayer == null || localPlayer.Spectating) return; var isAllied = Self.Owner.IsAlliedWith(localPlayer); Game.Sound.Play(SoundType.UI, isAllied ? Info.LaunchSound : Info.IncomingSound); - var toPlayer = isAllied ? localPlayer ?? Self.Owner : localPlayer; var speech = isAllied ? Info.LaunchSpeechNotification : Info.IncomingSpeechNotification; - Game.Sound.PlayNotification(Self.World.Map.Rules, toPlayer, "Speech", speech, toPlayer.Faction.InternalName); + Game.Sound.PlayNotification(Self.World.Map.Rules, localPlayer, "Speech", speech, localPlayer.Faction.InternalName); - TextNotificationsManager.AddTransientLine(isAllied ? Info.LaunchTextNotification : Info.IncomingTextNotification, toPlayer); + TextNotificationsManager.AddTransientLine(isAllied ? Info.LaunchTextNotification : Info.IncomingTextNotification, localPlayer); } public IEnumerable CellsMatching(CPos location, char[] footprint, CVec dimensions)