From 08efce8f6ba0db79565de2bf2bbdb4a12578af90 Mon Sep 17 00:00:00 2001 From: 1brucben <1benjbruce@gmail.com> Date: Fri, 25 Apr 2025 19:49:28 +0200 Subject: [PATCH] fix adjusted population --- src/core/configuration/DefaultConfig.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 37df1f063..a4148e43f 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -583,8 +583,12 @@ export class DefaultConfig implements Config { let toAdd = 10 + (800 / max + 1 / 160) * (0.7 * player.troops() + 1.3 * player.workers()); + const adjustedPop = + typeof player.adjustedPopulation === "function" + ? player.adjustedPopulation() + : player.population(); - const ratio = 1 - player.adjustedPopulation() / max; + const ratio = 1 - adjustedPop / max; toAdd *= ratio; if (player.type() == PlayerType.Bot) {