Implemented parenting and minimum default for loadout groups (#40861)
* Implemented parenting and minimum default for loadouts * Fix a mistake * Apply suggestion from @iaada Co-authored-by: āda <ss.adasts@gmail.com> * Implement @iaada's suggestion to rename MinDefault to DefaultSelected * happy little accidents * Moved Parents and Abstract fields to under ID, added inheritdoc --------- Co-authored-by: āda <ss.adasts@gmail.com>
This commit is contained in:
@@ -228,13 +228,13 @@ public sealed partial class RoleLoadout : IEquatable<RoleLoadout>
|
||||
var loadouts = new List<Loadout>();
|
||||
SelectedLoadouts[group] = loadouts;
|
||||
|
||||
if (groupProto.MinLimit > 0)
|
||||
if (groupProto.MinLimit > 0 || loadouts.Count < groupProto.DefaultSelected)
|
||||
{
|
||||
// Apply any loadouts we can.
|
||||
foreach (var protoId in groupProto.Loadouts)
|
||||
{
|
||||
// Reached the limit, time to stop
|
||||
if (loadouts.Count >= groupProto.MinLimit)
|
||||
if (loadouts.Count >= Math.Max(groupProto.MinLimit, groupProto.DefaultSelected))
|
||||
break;
|
||||
|
||||
if (!protoManager.TryIndex(protoId, out var loadoutProto))
|
||||
|
||||
Reference in New Issue
Block a user