Let species prototypes define valid sexes (Sex Refactor) (#11520)

This commit is contained in:
Rane
2022-10-15 17:45:47 -04:00
committed by GitHub
parent 0e18ba567c
commit c70e423ff6
14 changed files with 161 additions and 97 deletions

View File

@@ -67,9 +67,7 @@ public sealed class VocalSystem : EntitySystem
if (!_blocker.CanSpeak(uid))
return false;
var sex = Sex.Male; //the default is male because requiring humanoid appearance for this is dogshit
if (TryComp(uid, out HumanoidComponent? humanoid))
sex = humanoid.Sex;
var sex = CompOrNull<HumanoidComponent>(uid)?.Sex ?? Sex.Unsexed;
if (_random.Prob(component.WilhelmProbability))
{
@@ -89,7 +87,8 @@ public sealed class VocalSystem : EntitySystem
SoundSystem.Play(component.FemaleScream.GetSound(), Filter.Pvs(uid), uid, pitchedParams);
break;
default:
throw new ArgumentOutOfRangeException();
SoundSystem.Play(component.UnsexedScream.GetSound(), Filter.Pvs(uid), uid, pitchedParams);
break;
}
return true;