Skip to content

Commit

Permalink
not get the count twice
Browse files Browse the repository at this point in the history
  • Loading branch information
AlchlcDvl committed Oct 8, 2024
1 parent 8f26325 commit 0a61f09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MiraAPI/Modifiers/ModifierManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ internal static void AssignModifiers(List<PlayerControl> plrs)
{
var mod = Activator.CreateInstance(IdToTypeModifierMap[id]) as GameModifier;
var chance = Math.Clamp(mod!.GetAssignmentChance(), 0, 100);
var count = mod!.GetAmountPerGame();

if (chance == 0 || mod!.GetAmountPerGame() == 0)
if (chance == 0 || count == 0)
{
continue;
}
Expand All @@ -101,7 +102,7 @@ internal static void AssignModifiers(List<PlayerControl> plrs)
continue;
}

var num = Math.Clamp(mod!.GetAmountPerGame(), 0, maxCount);
var num = Math.Clamp(count, 0, maxCount);

for (var i = 0; i < num; i++)
{
Expand Down

0 comments on commit 0a61f09

Please sign in to comment.