From bb1f7441f400427696c7ba25750f2b580f589808 Mon Sep 17 00:00:00 2001 From: DEATHB4DEFEAT Date: Fri, 12 Jul 2024 12:33:17 -0700 Subject: [PATCH] fix announcer blacklist --- .../Announcements/Systems/AnnouncerSystem.Announcer.cs | 3 ++- Content.Shared/CCVar/CCVars.cs | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Content.Server/Announcements/Systems/AnnouncerSystem.Announcer.cs b/Content.Server/Announcements/Systems/AnnouncerSystem.Announcer.cs index a13f694f3c1..9b4c4bcb955 100644 --- a/Content.Server/Announcements/Systems/AnnouncerSystem.Announcer.cs +++ b/Content.Server/Announcements/Systems/AnnouncerSystem.Announcer.cs @@ -34,7 +34,8 @@ private void NewAnnouncer() public AnnouncerPrototype PickAnnouncer() { var list = _proto.Index(_config.GetCVar(CCVars.AnnouncerList)); - var modWeights = list.Weights.Where(a => !_config.GetCVar(CCVars.AnnouncerBlacklist).Contains(a.Key)); + var blacklist = _config.GetCVar(CCVars.AnnouncerBlacklist).Split(',').Select(a => a.Trim()).ToList(); + var modWeights = list.Weights.Where(a => !blacklist.Contains(a.Key)); list = new WeightedRandomPrototype(); foreach (var (key, value) in modWeights) diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index ad172726d9b..a772d7c12ad 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -453,9 +453,10 @@ public static readonly CVarDef /// /// Optionally blacklist announcers + /// List of IDs separated by commas /// - public static readonly CVarDef> AnnouncerBlacklist = - CVarDef.Create("announcer.blacklist", new List(), CVar.SERVERONLY); + public static readonly CVarDef AnnouncerBlacklist = + CVarDef.Create("announcer.blacklist", "", CVar.SERVERONLY); /// /// Changes how loud the announcers are for the client