Skip to content

Commit

Permalink
Fixes Weather Soundspam(And Crash) (#1501)
Browse files Browse the repository at this point in the history
# Description

Pretty simple fix, just tell the weather system "If there's already a
weather sound playing, stop.". I have infact tested this, and verified
that this fix does work.

Fixes Simple-Station/Einstein-Engines#1285

# Changelog

:cl:
- fix: Fixed a crash caused by Weather System creating millions of
sounds.

(cherry picked from commit 28415f18a1cb2549e9faa29c1ce66889dc0ef323)
  • Loading branch information
VMSolidus authored and Spatison committed Jan 13, 2025
1 parent 8b8e83a commit 2848060
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Content.Client/Weather/WeatherSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ protected override void Run(EntityUid uid, WeatherData weather, WeatherPrototype
return;
}

if (!Timing.IsFirstTimePredicted || weatherProto.Sound == null)
if (!Timing.IsFirstTimePredicted || weatherProto.Sound == null
|| weather.Stream is not null) // Don't ever generate more than one weather sound.
return;

// WD EDIT START
Expand Down

0 comments on commit 2848060

Please sign in to comment.