Fix end of round messages looping forever (#24920)
* Fix End of Round messages looping forever and ever and ever * Use the correct setting for round restart sounds
This commit is contained in:
@@ -25,6 +25,7 @@ public sealed class BackgroundAudioSystem : EntitySystem
|
|||||||
[Dependency] private readonly IStateManager _stateManager = default!;
|
[Dependency] private readonly IStateManager _stateManager = default!;
|
||||||
|
|
||||||
private readonly AudioParams _lobbyParams = new(-5f, 1, "Master", 0, 0, 0, true, 0f);
|
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? LobbyMusicStream;
|
||||||
public EntityUid? LobbyRoundRestartAudioStream;
|
public EntityUid? LobbyRoundRestartAudioStream;
|
||||||
@@ -139,7 +140,7 @@ public sealed class BackgroundAudioSystem : EntitySystem
|
|||||||
|
|
||||||
private void PlayRestartSound(RoundRestartCleanupEvent ev)
|
private void PlayRestartSound(RoundRestartCleanupEvent ev)
|
||||||
{
|
{
|
||||||
if (!_configManager.GetCVar(CCVars.LobbyMusicEnabled))
|
if (!_configManager.GetCVar(CCVars.RestartSoundsEnabled))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var file = _gameTicker.RestartSound;
|
var file = _gameTicker.RestartSound;
|
||||||
@@ -152,7 +153,7 @@ public sealed class BackgroundAudioSystem : EntitySystem
|
|||||||
file,
|
file,
|
||||||
Filter.Local(),
|
Filter.Local(),
|
||||||
false,
|
false,
|
||||||
_lobbyParams.WithVolume(_lobbyParams.Volume + SharedAudioSystem.GainToVolume(_configManager.GetCVar(CCVars.LobbyMusicVolume)))
|
_roundEndParams.WithVolume(_roundEndParams.Volume + SharedAudioSystem.GainToVolume(_configManager.GetCVar(CCVars.LobbyMusicVolume)))
|
||||||
)?.Entity;
|
)?.Entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user