]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Don't show the Meteor Swarm announcement to players in the lobby. (#30922)
authorMervill <mervills.email@gmail.com>
Mon, 12 Aug 2024 02:13:28 +0000 (19:13 -0700)
committerGitHub <noreply@github.com>
Mon, 12 Aug 2024 02:13:28 +0000 (12:13 +1000)
Content.Server/StationEvents/Events/MeteorSwarmSystem.cs
Content.Server/StationEvents/Events/StationEventSystem.cs

index 3f51834e3a681947762df2d3b51d89297a8d752a..948fedf6fc1b3fd5ab82ad7c2b21e3edc53106c5 100644 (file)
@@ -28,9 +28,13 @@ public sealed class MeteorSwarmSystem : GameRuleSystem<MeteorSwarmComponent>
 
         component.WaveCounter = component.Waves.Next(RobustRandom);
 
+        // we don't want to send to players who aren't in game (i.e. in the lobby)
+        Filter allPlayersInGame = Filter.Empty().AddWhere(GameTicker.UserHasJoinedGame);
+
         if (component.Announcement is { } locId)
-            _chat.DispatchGlobalAnnouncement(Loc.GetString(locId), playSound: false, colorOverride: Color.Gold);
-        _audio.PlayGlobal(component.AnnouncementSound, Filter.Broadcast(), true);
+            _chat.DispatchFilteredAnnouncement(allPlayersInGame, Loc.GetString(locId), playSound: false, colorOverride: Color.Gold);
+
+        _audio.PlayGlobal(component.AnnouncementSound, allPlayersInGame, true);
     }
 
     protected override void ActiveTick(EntityUid uid, MeteorSwarmComponent component, GameRuleComponent gameRule, float frameTime)
index 67643a8df57c26a0c20d7b69762e70fc9c8bad12..aaa48a482ec3f02e46f6e7286cc1d94ddfd3cb1f 100644 (file)
@@ -22,7 +22,6 @@ public abstract class StationEventSystem<T> : GameRuleSystem<T> where T : ICompo
     [Dependency] protected readonly ChatSystem ChatSystem = default!;
     [Dependency] protected readonly SharedAudioSystem Audio = default!;
     [Dependency] protected readonly StationSystem StationSystem = default!;
-    [Dependency] protected readonly GameTicker GameTicker = default!;
 
     protected ISawmill Sawmill = default!;