From 4669d6b37858f046229f76a7264f3953eb5b9d86 Mon Sep 17 00:00:00 2001 From: abcdefg30 Date: Sun, 6 Sep 2020 16:53:48 +0200 Subject: [PATCH] Work around a sound issue when loading saves --- OpenRA.Mods.Common/Traits/World/MusicPlaylist.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/World/MusicPlaylist.cs b/OpenRA.Mods.Common/Traits/World/MusicPlaylist.cs index e8b0ce6bc0..b3dc45e366 100644 --- a/OpenRA.Mods.Common/Traits/World/MusicPlaylist.cs +++ b/OpenRA.Mods.Common/Traits/World/MusicPlaylist.cs @@ -69,9 +69,6 @@ namespace OpenRA.Mods.Common.Traits this.info = info; this.world = world; - if (info.DisableWorldSounds) - Game.Sound.DisableWorldSounds = true; - IsMusicInstalled = world.Map.Rules.InstalledMusic.Any(); if (!IsMusicInstalled) return; @@ -105,6 +102,9 @@ namespace OpenRA.Mods.Common.Traits void IWorldLoaded.WorldLoaded(World world, WorldRenderer wr) { + // Reset any bogus pre-existing state + Game.Sound.DisableWorldSounds = info.DisableWorldSounds; + if (!world.IsLoadingGameSave) Play(); }