Humanoid fixes (#11538)

* humanoid sexmorph sprite restoration

can't believe i broke sex/gender AGAIN

* fixes default species appearances with no profile, tweaks randomization to no longer randomize species

* A

* fixes an oops

#11494
This commit is contained in:
Flipp Syder
2022-09-26 12:46:57 -07:00
committed by GitHub
parent 66e9c1975a
commit 0e1a190e0e
14 changed files with 107 additions and 31 deletions

View File

@@ -39,6 +39,7 @@ public sealed partial class HumanoidSystem : SharedHumanoidSystem
component.Species,
component.CustomBaseLayers,
component.SkinColor,
component.Sex,
component.AllHiddenLayers.ToList(),
component.CurrentMarkings.GetForwardEnumerator().ToList());
}
@@ -50,19 +51,20 @@ public sealed partial class HumanoidSystem : SharedHumanoidSystem
return;
}
SetSpecies(uid, humanoid.Species, false, humanoid);
if (!string.IsNullOrEmpty(humanoid.Initial)
&& _prototypeManager.TryIndex(humanoid.Initial, out HumanoidProfilePrototype? startingSet))
if (string.IsNullOrEmpty(humanoid.Initial)
|| !_prototypeManager.TryIndex(humanoid.Initial, out HumanoidProfilePrototype? startingSet))
{
// Do this first, because profiles currently do not support custom base layers
foreach (var (layer, info) in startingSet.CustomBaseLayers)
{
humanoid.CustomBaseLayers.Add(layer, info);
}
LoadProfile(uid, startingSet.Profile, humanoid);
LoadProfile(uid, HumanoidCharacterProfile.DefaultWithSpecies(humanoid.Species), humanoid);
return;
}
// Do this first, because profiles currently do not support custom base layers
foreach (var (layer, info) in startingSet.CustomBaseLayers)
{
humanoid.CustomBaseLayers.Add(layer, info);
}
LoadProfile(uid, startingSet.Profile, humanoid);
}
private void OnExamined(EntityUid uid, HumanoidComponent component, ExaminedEvent args)