From a6a3365175ff34f409ca73ea39de144510707e1c Mon Sep 17 00:00:00 2001 From: Chomp Date: Wed, 15 Dec 2021 09:01:45 +0000 Subject: [PATCH] Return a max percentage of 100 for mod/gear chances --- Generator/Helpers/Gear/GearChanceHelpers.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Generator/Helpers/Gear/GearChanceHelpers.cs b/Generator/Helpers/Gear/GearChanceHelpers.cs index a2e44ab..d3906cc 100644 --- a/Generator/Helpers/Gear/GearChanceHelpers.cs +++ b/Generator/Helpers/Gear/GearChanceHelpers.cs @@ -190,7 +190,8 @@ namespace Generator.Helpers.Gear private static int GetPercent(int total, int count) { - return (int)Math.Ceiling((double)(((200 * count) + 1) / (total * 2))); + var percentChance = (int)Math.Ceiling((double)(((200 * count) + 1) / (total * 2))); + return percentChance > 100 ? 100 : percentChance; // return 100 if value is > 100 } private static MinMax GetMagazineCountByBotType(BotType botType)