From 88549da309679cf58fe34ca1528879eb24cea9c5 Mon Sep 17 00:00:00 2001 From: Moony Date: Sat, 16 Apr 2022 17:23:22 -0500 Subject: [PATCH] moop (#7594) --- Content.Server/GameTicking/GameTicker.LobbyBackground.cs | 8 +++++--- Content.Server/GameTicking/GameTicker.RoundFlow.cs | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Content.Server/GameTicking/GameTicker.LobbyBackground.cs b/Content.Server/GameTicking/GameTicker.LobbyBackground.cs index d701db91c8..26e15cb0a2 100644 --- a/Content.Server/GameTicking/GameTicker.LobbyBackground.cs +++ b/Content.Server/GameTicking/GameTicker.LobbyBackground.cs @@ -22,8 +22,6 @@ public sealed partial class GameTicker private static readonly string[] WhitelistedBackgroundExtensions = new string[] {"png", "jpg", "jpeg"}; - private const string LobbyScreenPath = "/Textures/LobbyScreens"; - private void InitializeLobbyBackground() { _lobbyBackgrounds = _prototypeManager.EnumeratePrototypes() @@ -31,7 +29,11 @@ public sealed partial class GameTicker .Where(x => WhitelistedBackgroundExtensions.Contains(x.Extension)) .ToList(); - LobbyBackground = _lobbyBackgrounds.Any() ? _robustRandom.Pick(_lobbyBackgrounds).ToString() : null; + RandomizeLobbyBackground(); } + + private void RandomizeLobbyBackground() { + LobbyBackground = _lobbyBackgrounds!.Any() ? _robustRandom.Pick(_lobbyBackgrounds!).ToString() : null; + } } diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index 1f5f1166df..07f820cf2e 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -348,6 +348,7 @@ namespace Content.Server.GameTicking RunLevel = GameRunLevel.PreRoundLobby; LobbySong = _robustRandom.Pick(_lobbyMusicCollection.PickFiles).ToString(); + RandomizeLobbyBackground(); ResettingCleanup(); if (!LobbyEnabled)