diff --git a/Content.Shared/Preferences/Loadouts/RoleLoadout.cs b/Content.Shared/Preferences/Loadouts/RoleLoadout.cs index d02929cd9657..ca6d841616d7 100644 --- a/Content.Shared/Preferences/Loadouts/RoleLoadout.cs +++ b/Content.Shared/Preferences/Loadouts/RoleLoadout.cs @@ -193,9 +193,14 @@ public void SetDefault(HumanoidCharacterProfile? profile, ICommonSession? sessio if (groupProto.MinLimit > 0) { // Apply any loadouts we can. - for (var j = 0; j < Math.Min(groupProto.MinLimit, groupProto.Loadouts.Count); j++) + var addedCount = 0; + foreach (var protoId in groupProto.Loadouts) { - if (!protoManager.TryIndex(groupProto.Loadouts[j], out var loadoutProto)) + // Reached the limit, time to stop + if (addedCount >= groupProto.MinLimit) + break; + + if (!protoManager.TryIndex(protoId, out var loadoutProto)) continue; var defaultLoadout = new Loadout() @@ -209,6 +214,7 @@ public void SetDefault(HumanoidCharacterProfile? profile, ICommonSession? sessio loadouts.Add(defaultLoadout); Apply(loadoutProto); + addedCount++; } } } diff --git a/Resources/Prototypes/Loadouts/loadout_groups.yml b/Resources/Prototypes/Loadouts/loadout_groups.yml index 530022424ec0..e3da71b4c161 100644 --- a/Resources/Prototypes/Loadouts/loadout_groups.yml +++ b/Resources/Prototypes/Loadouts/loadout_groups.yml @@ -38,8 +38,8 @@ - type: loadoutGroup id: Survival name: loadout-group-survival-basic - minLimit: 2 - maxLimit: 2 + minLimit: 1 + maxLimit: 1 hidden: true loadouts: - EmergencyNitrogen