Skip to content

Commit

Permalink
fix announcer blacklist
Browse files Browse the repository at this point in the history
  • Loading branch information
DEATHB4DEFEAT committed Jul 12, 2024
1 parent 781ca6b commit bb1f744
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ private void NewAnnouncer()
public AnnouncerPrototype PickAnnouncer()
{
var list = _proto.Index<WeightedRandomPrototype>(_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)
Expand Down
5 changes: 3 additions & 2 deletions Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,10 @@ public static readonly CVarDef<bool>

/// <summary>
/// Optionally blacklist announcers
/// List of IDs separated by commas
/// </summary>
public static readonly CVarDef<List<string>> AnnouncerBlacklist =
CVarDef.Create("announcer.blacklist", new List<string>(), CVar.SERVERONLY);
public static readonly CVarDef<string> AnnouncerBlacklist =
CVarDef.Create("announcer.blacklist", "", CVar.SERVERONLY);

/// <summary>
/// Changes how loud the announcers are for the client
Expand Down

0 comments on commit bb1f744

Please sign in to comment.