]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix end of round messages looping forever (#24920)
authornikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
Sat, 3 Feb 2024 16:43:50 +0000 (18:43 +0200)
committerGitHub <noreply@github.com>
Sat, 3 Feb 2024 16:43:50 +0000 (03:43 +1100)
* Fix End of Round messages looping forever and ever and ever

* Use the correct setting for round restart sounds

Content.Client/Audio/BackgroundAudioSystem.cs

index 9c4bf3f266e0f4fedf36a7d7d54aea2652875eb2..29279830627e85cb6ae80c29c8e7a789d8132c75 100644 (file)
@@ -25,6 +25,7 @@ public sealed class BackgroundAudioSystem : EntitySystem
     [Dependency] private readonly IStateManager _stateManager = default!;
 
     private readonly AudioParams _lobbyParams = new(-5f, 1, "Master", 0, 0, 0, true, 0f);
+    private readonly AudioParams _roundEndParams = new(-5f, 1, "Master", 0, 0, 0, false, 0f);
 
     public EntityUid? LobbyMusicStream;
     public EntityUid? LobbyRoundRestartAudioStream;
@@ -139,7 +140,7 @@ public sealed class BackgroundAudioSystem : EntitySystem
 
     private void PlayRestartSound(RoundRestartCleanupEvent ev)
     {
-        if (!_configManager.GetCVar(CCVars.LobbyMusicEnabled))
+        if (!_configManager.GetCVar(CCVars.RestartSoundsEnabled))
             return;
 
         var file = _gameTicker.RestartSound;
@@ -152,7 +153,7 @@ public sealed class BackgroundAudioSystem : EntitySystem
             file,
             Filter.Local(),
             false,
-            _lobbyParams.WithVolume(_lobbyParams.Volume + SharedAudioSystem.GainToVolume(_configManager.GetCVar(CCVars.LobbyMusicVolume)))
+            _roundEndParams.WithVolume(_roundEndParams.Volume + SharedAudioSystem.GainToVolume(_configManager.GetCVar(CCVars.LobbyMusicVolume)))
         )?.Entity;
     }
 }