From: UpAndLeaves <92269094+Alpha-Two@users.noreply.github.com> Date: Mon, 8 Dec 2025 01:37:06 +0000 (+0000) Subject: Allow removing species from the RNG pool of a new player's initial auto-generated... X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=fde6129e5f79d996342cd10e2cc0ab4aed8a2d56;p=space-station-14.git Allow removing species from the RNG pool of a new player's initial auto-generated character (#41678) * First commit * Fix it! * Requested Changes --- diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index 6d2f3fac52..00b0c0ff32 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -394,7 +394,9 @@ namespace Content.Server.GameTicking } else { - profile = HumanoidCharacterProfile.Random(); + var speciesToBlacklist = + new HashSet(_cfg.GetCVar(CCVars.ICNewAccountSpeciesBlacklist).Split(",")); + profile = HumanoidCharacterProfile.Random(speciesToBlacklist); } readyPlayerProfiles.Add(userId, profile); } diff --git a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs index 7ece769d54..10380f6b7f 100644 --- a/Content.Server/Preferences/Managers/ServerPreferencesManager.cs +++ b/Content.Server/Preferences/Managers/ServerPreferencesManager.cs @@ -334,7 +334,9 @@ namespace Content.Server.Preferences.Managers var prefs = await _db.GetPlayerPreferencesAsync(userId, cancel); if (prefs is null) { - return await _db.InitPrefsAsync(userId, HumanoidCharacterProfile.Random(), cancel); + var speciesToBlacklist = + new HashSet(_cfg.GetCVar(CCVars.ICNewAccountSpeciesBlacklist).Split(",")); + return await _db.InitPrefsAsync(userId, HumanoidCharacterProfile.Random(speciesToBlacklist), cancel); } return prefs; diff --git a/Content.Shared/CCVar/CCVars.Ic.cs b/Content.Shared/CCVar/CCVars.Ic.cs index 5f8d108a22..a075bb0144 100644 --- a/Content.Shared/CCVar/CCVars.Ic.cs +++ b/Content.Shared/CCVar/CCVars.Ic.cs @@ -65,6 +65,13 @@ public sealed partial class CCVars public static readonly CVarDef ICRandomSpeciesWeights = CVarDef.Create("ic.random_species_weights", "SpeciesWeights", CVar.SERVER); + /// + /// The list of species that will NOT be given to new account joins when they are assigned a random character. + /// This only affects the first time a character is made for an account, nothing else. + /// + public static readonly CVarDef ICNewAccountSpeciesBlacklist = + CVarDef.Create("ic.blacklist_species_new_account", "Diona,Vulpkanin,Vox,SlimePerson", CVar.SERVER); + /// /// Control displaying SSD indicators near players /// diff --git a/Resources/Prototypes/Species/species_weights.yml b/Resources/Prototypes/Species/species_weights.yml index e226d2064a..a516795ffb 100644 --- a/Resources/Prototypes/Species/species_weights.yml +++ b/Resources/Prototypes/Species/species_weights.yml @@ -5,5 +5,8 @@ Human: 5 Reptilian: 4 SlimePerson: 4 + Moth: 4 + Dwarf: 2 Diona: 2 + Vox: 1 Vulpkanin: 4