diff --git a/Content.Shared/Preferences/HumanoidCharacterProfile.cs b/Content.Shared/Preferences/HumanoidCharacterProfile.cs index 3ee162fe72..fd95848d2c 100644 --- a/Content.Shared/Preferences/HumanoidCharacterProfile.cs +++ b/Content.Shared/Preferences/HumanoidCharacterProfile.cs @@ -467,10 +467,10 @@ namespace Content.Shared.Preferences var configManager = collection.Resolve(); var prototypeManager = collection.Resolve(); - if (!prototypeManager.TryIndex(Species, out var speciesPrototype) || speciesPrototype.RoundStart == false) + if (!prototypeManager.TryIndex(Species, out var speciesPrototype) || speciesPrototype.RoundStart == false) { Species = SharedHumanoidAppearanceSystem.DefaultSpecies; - speciesPrototype = prototypeManager.Index(Species); + speciesPrototype = prototypeManager.Index(Species); } var sex = Sex switch diff --git a/Content.Shared/Preferences/Loadouts/RoleLoadout.cs b/Content.Shared/Preferences/Loadouts/RoleLoadout.cs index 18c3501ea6..5f8e24621a 100644 --- a/Content.Shared/Preferences/Loadouts/RoleLoadout.cs +++ b/Content.Shared/Preferences/Loadouts/RoleLoadout.cs @@ -59,6 +59,16 @@ public sealed partial class RoleLoadout : IEquatable return; } + // In some instances we might not have picked up a new group for existing data. + foreach (var groupProto in roleProto.Groups) + { + if (SelectedLoadouts.ContainsKey(groupProto)) + continue; + + // Data will get set below. + SelectedLoadouts[groupProto] = new List(); + } + // Reset points to recalculate. Points = roleProto.Points; @@ -156,6 +166,7 @@ public sealed partial class RoleLoadout : IEquatable /// /// Resets the selected loadouts to default if no data is present. /// + /// Clear existing data first public void SetDefault(IPrototypeManager protoManager, bool force = false) { if (force)