From bc7bf174d86bb9d2fef3e9193c5a985257ce370f Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Fri, 19 Jun 2020 18:23:51 +0200 Subject: [PATCH] Don't tick the announcement timer when not in low power When entering low power it will be reset to 0 again anyway --- OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs b/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs index 4d116d9b38..bd4d7d22a1 100644 --- a/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs +++ b/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs @@ -149,11 +149,9 @@ namespace OpenRA.Mods.Common.Traits UpdatePowerState(); } - if (--nextPowerAdviceTime <= 0) + if (isLowPower && --nextPowerAdviceTime <= 0) { - if (isLowPower) - Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Faction.InternalName); - + Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Faction.InternalName); nextPowerAdviceTime = info.AdviceInterval; }