From 7887f78f0da80213101558d2b19eaea59de65d5f Mon Sep 17 00:00:00 2001 From: Swept Date: Fri, 21 Aug 2020 09:26:31 -0700 Subject: [PATCH] Restricts character age from being under 18 or over 120 years old (#1836) --- Content.Shared/Preferences/HumanoidCharacterProfile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Preferences/HumanoidCharacterProfile.cs b/Content.Shared/Preferences/HumanoidCharacterProfile.cs index 58633d2a2a..0f2feac203 100644 --- a/Content.Shared/Preferences/HumanoidCharacterProfile.cs +++ b/Content.Shared/Preferences/HumanoidCharacterProfile.cs @@ -11,7 +11,7 @@ namespace Content.Shared.Preferences private readonly Dictionary _jobPriorities; private readonly List _antagPreferences; public static int MinimumAge = 18; - public static int MaximumAge = 90; + public static int MaximumAge = 120; private HumanoidCharacterProfile( string name, @@ -69,7 +69,7 @@ namespace Content.Shared.Preferences public HumanoidCharacterProfile WithAge(int age) { - return new HumanoidCharacterProfile(Name, age, Sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences); + return new HumanoidCharacterProfile(Name, Math.Clamp(age, MinimumAge, MaximumAge), Sex, Appearance, _jobPriorities, PreferenceUnavailable, _antagPreferences); } public HumanoidCharacterProfile WithSex(Sex sex)