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)
[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!;