From 6220ba4f06fd6aa045d32e86a99aa1d79556c3df Mon Sep 17 00:00:00 2001 From: AlchlcDvl <56699741+AlchlcDvl@users.noreply.github.com> Date: Sat, 5 Oct 2024 21:08:59 -0400 Subject: [PATCH] why check the players twice --- MiraAPI/Modifiers/ModifierManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MiraAPI/Modifiers/ModifierManager.cs b/MiraAPI/Modifiers/ModifierManager.cs index f9065ea..18c6700 100644 --- a/MiraAPI/Modifiers/ModifierManager.cs +++ b/MiraAPI/Modifiers/ModifierManager.cs @@ -87,14 +87,14 @@ internal static void AssignModifiers(List plrs) foreach (var modifier in PrioritiesToIdsMap[priority]) { var mod = Activator.CreateInstance(IdToTypeModifierMap[modifier]) as GameModifier; + var maxCount = plrs.Count(x => IsGameModifierValid(x, mod!, modifier)); - if (!plrs.Exists(x => IsGameModifierValid(x, mod!, modifier))) + if (maxCount == 0) { Logger.Warning("No players are valid for modifier: " + mod!.ModifierName); continue; } - var maxCount = plrs.Count(x => IsGameModifierValid(x, mod!, modifier)); var num = Math.Clamp(mod!.GetAmountPerGame(), 0, maxCount); var chance = mod.GetAssignmentChance();