Make Loadout MinLimit not count failed attempts (#29264)
Loadout MinLimit doesn't count failed attempts
This commit is contained in:
parent
a1e7e175c5
commit
384e43bca4
|
|
@ -193,9 +193,14 @@ public sealed partial class RoleLoadout : IEquatable<RoleLoadout>
|
|||
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 sealed partial class RoleLoadout : IEquatable<RoleLoadout>
|
|||
|
||||
loadouts.Add(defaultLoadout);
|
||||
Apply(loadoutProto);
|
||||
addedCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,16 @@
|
|||
- GlassesJamjar
|
||||
- GlassesJensen
|
||||
|
||||
#- type: loadoutGroup
|
||||
# id: Survival
|
||||
# name: loadout-group-survival-basic
|
||||
# minLimit: 1
|
||||
# maxLimit: 1
|
||||
# hidden: true
|
||||
# loadouts:
|
||||
# - EmergencyNitrogen
|
||||
# - EmergencyOxygen
|
||||
|
||||
# Command
|
||||
- type: loadoutGroup
|
||||
id: CaptainHead
|
||||
|
|
|
|||
Loading…
Reference in New Issue