Fix Loadout Requirements Only Displaying One Requirement (#28994)

Collect all group effects failed instead of only first one failed
This commit is contained in:
Thomas 2024-06-14 15:32:39 -05:00 committed by GitHub
parent 2711ef7f48
commit 9ebfb1d64f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 4 deletions

View File

@ -17,13 +17,16 @@ public sealed partial class GroupLoadoutEffect : LoadoutEffect
{
var effectsProto = collection.Resolve<IPrototypeManager>().Index(Proto);
var reasons = new List<string>();
foreach (var effect in effectsProto.Effects)
{
if (!effect.Validate(profile, loadout, session, collection, out reason))
return false;
if (effect.Validate(profile, loadout, session, collection, out reason))
continue;
reasons.Add(reason.ToMarkup());
}
reason = null;
return true;
reason = reasons.Count == 0 ? null : FormattedMessage.FromMarkup(string.Join('\n', reasons));
return reason == null;
}
}