Allow removing species from the RNG pool of a new player's initial auto-generated character (#41678)

* First commit

* Fix it!

* Requested Changes
This commit is contained in:
UpAndLeaves
2025-12-08 01:37:06 +00:00
committed by GitHub
parent 5fa2028ce9
commit fde6129e5f
4 changed files with 16 additions and 2 deletions

View File

@@ -394,7 +394,9 @@ namespace Content.Server.GameTicking
}
else
{
profile = HumanoidCharacterProfile.Random();
var speciesToBlacklist =
new HashSet<string>(_cfg.GetCVar(CCVars.ICNewAccountSpeciesBlacklist).Split(","));
profile = HumanoidCharacterProfile.Random(speciesToBlacklist);
}
readyPlayerProfiles.Add(userId, profile);
}

View File

@@ -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<string>(_cfg.GetCVar(CCVars.ICNewAccountSpeciesBlacklist).Split(","));
return await _db.InitPrefsAsync(userId, HumanoidCharacterProfile.Random(speciesToBlacklist), cancel);
}
return prefs;

View File

@@ -65,6 +65,13 @@ public sealed partial class CCVars
public static readonly CVarDef<string> ICRandomSpeciesWeights =
CVarDef.Create("ic.random_species_weights", "SpeciesWeights", CVar.SERVER);
/// <summary>
/// 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.
/// </summary>
public static readonly CVarDef<string> ICNewAccountSpeciesBlacklist =
CVarDef.Create("ic.blacklist_species_new_account", "Diona,Vulpkanin,Vox,SlimePerson", CVar.SERVER);
/// <summary>
/// Control displaying SSD indicators near players
/// </summary>

View File

@@ -5,5 +5,8 @@
Human: 5
Reptilian: 4
SlimePerson: 4
Moth: 4
Dwarf: 2
Diona: 2
Vox: 1
Vulpkanin: 4