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 effectsProto = collection.Resolve<IPrototypeManager>().Index(Proto);
|
||||||
|
|
||||||
|
var reasons = new List<string>();
|
||||||
foreach (var effect in effectsProto.Effects)
|
foreach (var effect in effectsProto.Effects)
|
||||||
{
|
{
|
||||||
if (!effect.Validate(profile, loadout, session, collection, out reason))
|
if (effect.Validate(profile, loadout, session, collection, out reason))
|
||||||
return false;
|
continue;
|
||||||
|
|
||||||
|
reasons.Add(reason.ToMarkup());
|
||||||
}
|
}
|
||||||
|
|
||||||
reason = null;
|
reason = reasons.Count == 0 ? null : FormattedMessage.FromMarkup(string.Join('\n', reasons));
|
||||||
return true;
|
return reason == null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user