From 23cdd00537c8142fd7ec82e1b74431692d0b2615 Mon Sep 17 00:00:00 2001 From: 1brucben <1benjbruce@gmail.com> Date: Mon, 2 Jun 2025 02:38:24 +0200 Subject: [PATCH] fix NA in ratio --- src/core/configuration/DefaultConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 6e8ba04d9..b2dcd3104 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -649,7 +649,7 @@ export class DefaultConfig implements Config { const reproductionPop = player.troops() + 1.15 * player.workers(); let toAdd = baseAdditionRate + basePopGrowthRate * reproductionPop; const totalPop = player.totalPopulation(); - const ratio = 1 - totalPop / max; + const ratio = Math.max(1 - totalPop / max, 0); toAdd *= ratio ** 1.222; if (player.type() === PlayerType.Bot) {