Make lobby song update occur at round end (#19303)

This commit is contained in:
Vordenburg
2023-08-21 14:54:44 -04:00
committed by GitHub
parent 4f89f08e75
commit 2cbe8609a3
3 changed files with 24 additions and 23 deletions

View File

@@ -34,7 +34,7 @@ public sealed class BackgroundAudioSystem : EntitySystem
_client.PlayerLeaveServer += OnLeave;
_gameTicker.LobbyStatusUpdated += LobbySongReceived;
_gameTicker.LobbySongUpdated += LobbySongUpdated;
}
public override void Shutdown()
@@ -48,7 +48,7 @@ public sealed class BackgroundAudioSystem : EntitySystem
_client.PlayerLeaveServer -= OnLeave;
_gameTicker.LobbyStatusUpdated -= LobbySongReceived;
_gameTicker.LobbySongUpdated -= LobbySongUpdated;
EndLobbyMusic();
}
@@ -95,17 +95,9 @@ public sealed class BackgroundAudioSystem : EntitySystem
}
}
private void LobbySongReceived()
private void LobbySongUpdated()
{
if (_lobbyStream != null) //Toggling Ready status fires this method. This check ensures we only start the lobby music if it's not playing.
{
return;
}
if (_stateManager.CurrentState is LobbyState)
{
StartLobbyMusic();
}
RestartLobbyMusic();
}
public void RestartLobbyMusic()