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