Add public sex method for those who don't have access to change sex (#9894)

This commit is contained in:
Rane
2022-07-19 17:18:13 -04:00
committed by GitHub
parent 85b03f3745
commit ed3578b0a1

View File

@@ -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);