From 1e95c700ebb6d8db77014bea8057105482a90904 Mon Sep 17 00:00:00 2001 From: "Mr. 27" <45323883+Dutch-VanDerLinde@users.noreply.github.com> Date: Mon, 19 Feb 2024 17:38:06 -0500 Subject: [PATCH] randomized sexless species now have epicene gender by default (#25282) Fikss --- .../Preferences/HumanoidCharacterProfile.cs | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Content.Shared/Preferences/HumanoidCharacterProfile.cs b/Content.Shared/Preferences/HumanoidCharacterProfile.cs index 09fb0072258fe2..22c37dcfe9ed7d 100644 --- a/Content.Shared/Preferences/HumanoidCharacterProfile.cs +++ b/Content.Shared/Preferences/HumanoidCharacterProfile.cs @@ -181,7 +181,17 @@ public static HumanoidCharacterProfile RandomWithSpecies(string species = Shared age = random.Next(speciesPrototype.MinAge, speciesPrototype.OldAge); // people don't look and keep making 119 year old characters with zero rp, cap it at middle aged } - var gender = sex == Sex.Male ? Gender.Male : Gender.Female; + var gender = Gender.Epicene; + + switch (sex) + { + case Sex.Male: + gender = Gender.Male; + break; + case Sex.Female: + gender = Gender.Female; + break; + } var name = GetName(species, gender); @@ -297,16 +307,16 @@ public HumanoidCharacterProfile WithAntagPreferences(IEnumerable antagPr public HumanoidCharacterProfile WithAntagPreference(string antagId, bool pref) { var list = new List(_antagPreferences); - if(pref) + if (pref) { - if(!list.Contains(antagId)) + if (!list.Contains(antagId)) { list.Add(antagId); } } else { - if(list.Contains(antagId)) + if (list.Contains(antagId)) { list.Remove(antagId); } @@ -319,16 +329,16 @@ public HumanoidCharacterProfile WithTraitPreference(string traitId, bool pref) var list = new List(_traitPreferences); // TODO: Maybe just refactor this to HashSet? Same with _antagPreferences - if(pref) + if (pref) { - if(!list.Contains(traitId)) + if (!list.Contains(traitId)) { list.Add(traitId); } } else { - if(list.Contains(traitId)) + if (list.Contains(traitId)) { list.Remove(traitId); }