Fix Loadout Requirements Only Displaying One Requirement (#28994)
Collect all group effects failed instead of only first one failed
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user