From ed3578b0a169877c8f3cea9300e3a3823592e631 Mon Sep 17 00:00:00 2001 From: Rane <60792108+Elijahrane@users.noreply.github.com> Date: Tue, 19 Jul 2022 17:18:13 -0400 Subject: [PATCH] Add public sex method for those who don't have access to change sex (#9894) --- .../Systems/SharedHumanoidAppearanceSystem.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Content.Shared/CharacterAppearance/Systems/SharedHumanoidAppearanceSystem.cs b/Content.Shared/CharacterAppearance/Systems/SharedHumanoidAppearanceSystem.cs index 67ce557eba..2cf03517eb 100644 --- a/Content.Shared/CharacterAppearance/Systems/SharedHumanoidAppearanceSystem.cs +++ b/Content.Shared/CharacterAppearance/Systems/SharedHumanoidAppearanceSystem.cs @@ -58,6 +58,17 @@ namespace Content.Shared.CharacterAppearance.Systems RaiseLocalEvent(uid, new ChangedHumanoidAppearanceEvent(appearance, component.Sex, component.Gender, component.Species), true); } + public void UpdateSexGender(EntityUid uid, Sex sex, Gender gender, HumanoidAppearanceComponent? component = null) + { + if (!Resolve(uid, ref component)) return; + + component.Sex = sex; + component.Gender = gender; + + component.Dirty(); + RaiseLocalEvent(uid, new ChangedHumanoidAppearanceEvent(component.Appearance, component.Sex, component.Gender, component.Species), true); + } + private void OnAppearanceGetState(EntityUid uid, HumanoidAppearanceComponent component, ref ComponentGetState args) { args.State = new HumanoidAppearanceComponentState(component.Appearance, component.Sex, component.Gender, component.Species, component.Age);