Fix some announcements code (#16585)
This commit is contained in:
@@ -524,19 +524,18 @@ namespace Content.Server.GameTicking
|
||||
{
|
||||
if (Preset == null) return;
|
||||
|
||||
foreach (var proto in _prototypeManager.EnumeratePrototypes<RoundAnnouncementPrototype>())
|
||||
{
|
||||
if (!proto.GamePresets.Contains(Preset.ID)) continue;
|
||||
var options = _prototypeManager.EnumeratePrototypes<RoundAnnouncementPrototype>().ToList();
|
||||
|
||||
if (proto.Message != null)
|
||||
_chatSystem.DispatchGlobalAnnouncement(Loc.GetString(proto.Message), playSound: true);
|
||||
if (options.Count == 0)
|
||||
return;
|
||||
|
||||
if (proto.Sound != null)
|
||||
SoundSystem.Play(proto.Sound.GetSound(), Filter.Broadcast());
|
||||
var proto = _robustRandom.Pick(options);
|
||||
|
||||
// Only play one because A
|
||||
break;
|
||||
}
|
||||
if (proto.Message != null)
|
||||
_chatSystem.DispatchGlobalAnnouncement(Loc.GetString(proto.Message), playSound: true);
|
||||
|
||||
if (proto.Sound != null)
|
||||
SoundSystem.Play(proto.Sound.GetSound(), Filter.Broadcast());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user