]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add loadout group check for role proto (#28731)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sat, 8 Jun 2024 10:03:54 +0000 (20:03 +1000)
committerGitHub <noreply@github.com>
Sat, 8 Jun 2024 10:03:54 +0000 (20:03 +1000)
MFW same bug twice at 2 layers because I'm stupid.

Content.Shared/Preferences/Loadouts/RoleLoadout.cs

index 479974893ceb2adbec42e2dd5b9ba86274da183b..b9d3a88338e8d9337074e731a6b3508baf687166 100644 (file)
@@ -64,6 +64,13 @@ public sealed partial class RoleLoadout : IEquatable<RoleLoadout>
 
         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
             if (!protoManager.TryIndex(group, out var groupProto))
             {