dont play weather sounds in lobby (#2978)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
parent
35e67a7814
commit
40b6f5bb2c
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue