From: Mervill Date: Mon, 12 Aug 2024 02:13:28 +0000 (-0700) Subject: Don't show the Meteor Swarm announcement to players in the lobby. (#30922) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=9f180e4f622768d1845477198ac86dde3fe94e03;p=space-station-14.git Don't show the Meteor Swarm announcement to players in the lobby. (#30922) --- diff --git a/Content.Server/StationEvents/Events/MeteorSwarmSystem.cs b/Content.Server/StationEvents/Events/MeteorSwarmSystem.cs index 3f51834e3a..948fedf6fc 100644 --- a/Content.Server/StationEvents/Events/MeteorSwarmSystem.cs +++ b/Content.Server/StationEvents/Events/MeteorSwarmSystem.cs @@ -28,9 +28,13 @@ public sealed class MeteorSwarmSystem : GameRuleSystem 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) diff --git a/Content.Server/StationEvents/Events/StationEventSystem.cs b/Content.Server/StationEvents/Events/StationEventSystem.cs index 67643a8df5..aaa48a482e 100644 --- a/Content.Server/StationEvents/Events/StationEventSystem.cs +++ b/Content.Server/StationEvents/Events/StationEventSystem.cs @@ -22,7 +22,6 @@ public abstract class StationEventSystem : GameRuleSystem 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!;