Add loadout group check for role proto (#28731)

MFW same bug twice at 2 layers because I'm stupid.
This commit is contained in:
metalgearsloth
2024-06-08 20:03:54 +10:00
committed by GitHub
parent b50faffcc3
commit 45015188cd

View File

@@ -64,6 +64,13 @@ public sealed partial class RoleLoadout : IEquatable<RoleLoadout>
foreach (var (group, groupLoadouts) in SelectedLoadouts) foreach (var (group, groupLoadouts) in SelectedLoadouts)
{ {
// Check the group is even valid for this role.
if (!roleProto.Groups.Contains(group))
{
groupRemove.Add(group);
continue;
}
// Dump if Group doesn't exist // Dump if Group doesn't exist
if (!protoManager.TryIndex(group, out var groupProto)) if (!protoManager.TryIndex(group, out var groupProto))
{ {