Skip to content

Commit

Permalink
why check the players twice
Browse files Browse the repository at this point in the history
  • Loading branch information
AlchlcDvl committed Oct 6, 2024
1 parent 9c9d222 commit 6220ba4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MiraAPI/Modifiers/ModifierManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,14 @@ internal static void AssignModifiers(List<PlayerControl> 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<MiraApiPlugin>.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();

Expand Down

0 comments on commit 6220ba4

Please sign in to comment.