Don't show the Meteor Swarm announcement to players in the lobby. (#30922)

This commit is contained in:
Mervill
2024-08-11 19:13:28 -07:00
committed by GitHub
parent a0a1421da4
commit 9f180e4f62
2 changed files with 6 additions and 3 deletions

View 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)

View 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!;