Add loadout group check (#28311)

Forgot to add it back in one of the rewrites.
This commit is contained in:
metalgearsloth
2024-05-27 18:04:34 +10:00
committed by GitHub
parent 642bcffbaf
commit 5a59c6f262

View File

@@ -78,12 +78,20 @@ public sealed partial class RoleLoadout : IEquatable<RoleLoadout>
{
var loadout = loadouts[i];
// Old prototype or otherwise invalid.
if (!protoManager.TryIndex(loadout.Prototype, out var loadoutProto))
{
loadouts.RemoveAt(i);
continue;
}
// Malicious client maybe, check the group even has it.
if (!groupProto.Loadouts.Contains(loadout.Prototype))
{
loadouts.RemoveAt(i);
continue;
}
// Validate the loadout can be applied (e.g. points).
if (!IsValid(profile, session, loadout.Prototype, collection, out _))
{