dont play weather sounds in lobby (#2978)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas 2025-02-14 22:58:12 +00:00 committed by GitHub
parent 35e67a7814
commit 40b6f5bb2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 0 deletions

View File

@ -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;