minor tweak

This commit is contained in:
Olivier Gagnon 2021-10-28 15:24:33 -04:00
parent f710c52bdc
commit dc88d9b478
3 changed files with 4 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -89,8 +89,8 @@ export function processSingleServerGrowth(server: Server, threads: number, p: IP
if (oldMoneyAvailable !== server.moneyAvailable) { if (oldMoneyAvailable !== server.moneyAvailable) {
//Growing increases server security twice as much as hacking //Growing increases server security twice as much as hacking
let usedCycles = numCycleForGrowth(server, server.moneyAvailable / oldMoneyAvailable, p, cores); let usedCycles = numCycleForGrowth(server, server.moneyAvailable / oldMoneyAvailable, p, cores);
usedCycles = Math.min(Math.max(0, usedCycles), threads); usedCycles = Math.min(Math.max(0, Math.ceil(usedCycles)), threads);
server.fortify(2 * CONSTANTS.ServerFortifyAmount * Math.ceil(usedCycles)); server.fortify(2 * CONSTANTS.ServerFortifyAmount * usedCycles);
} }
return server.moneyAvailable / oldMoneyAvailable; return server.moneyAvailable / oldMoneyAvailable;
} }