mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-27 01:53:48 +01:00
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)
This commit is contained in:
parent
5cc7a6a0a2
commit
bfaecc644d
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user