From bfaecc644d91047db848e97b3ab2974e4348de2b Mon Sep 17 00:00:00 2001 From: zeddrak <57454318+zeddrak@users.noreply.github.com> Date: Tue, 1 Feb 2022 14:34:27 -0800 Subject: [PATCH] startMoney check should be >= moneyMax, not == Just realized that I checked for exactly equal (as would be likely when operating internally), but really, it should treat anything greater than or equal to as a zero growth scenario (just better protection from a wider range of potential issues) --- src/Server/ServerHelpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Server/ServerHelpers.ts b/src/Server/ServerHelpers.ts index 2c05d2b9b..610900415 100644 --- a/src/Server/ServerHelpers.ts +++ b/src/Server/ServerHelpers.ts @@ -106,7 +106,7 @@ export function numCycleForGrowthTransition(server: Server, growth: number, p: I * @returns Number of "growth cycles" needed */ export function numCycleForGrowthCorrected(server: Server, targetMoney: number, startMoney: number, p: IPlayer, cores = 1): number { - if (startMoney == server.moneyMax) { return 0; } //no growth possible, no threads needed + if (startMoney >= server.moneyMax) { return 0; } //no growth possible, no threads needed if (startMoney < 0) { startMoney = 0; } // servers "can't" have less than 0 dollars on them if (targetMoney > server.moneyMax) { targetMoney = server.moneyMax; } // can't grow a server to more than its moneyMax