From 40b6f5bb2c8fc6efa1d442c5d44a4f9a75b6fabf Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Fri, 14 Feb 2025 22:58:12 +0000 Subject: [PATCH] dont play weather sounds in lobby (#2978) Co-authored-by: deltanedas <@deltanedas:kde.org> --- Content.Client/Weather/WeatherSystem.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Content.Client/Weather/WeatherSystem.cs b/Content.Client/Weather/WeatherSystem.cs index 975831392c..5e416d8a0d 100644 --- a/Content.Client/Weather/WeatherSystem.cs +++ b/Content.Client/Weather/WeatherSystem.cs @@ -128,6 +128,20 @@ public sealed class WeatherSystem : SharedWeatherSystem if (!Timing.IsFirstTimePredicted) return true; + // Begin DeltaV Additions: Prevent hearing weather in the lobby + if (_playerManager.LocalEntity is not {} ent) + return false; + + var map = Transform(uid).MapUid; + var entMap = Transform(ent).MapUid; + + if (map == null || entMap != map) + { + weather.Stream = _audio.Stop(weather.Stream); + return false; + } + // End DeltaV Additions + // TODO: Fades (properly) weather.Stream = _audio.Stop(weather.Stream); weather.Stream = _audio.PlayGlobal(weatherProto.Sound, Filter.Local(), true)?.Entity;