background primary/secondary and fix securtiy with grow

This commit is contained in:
Olivier Gagnon
2021-10-28 15:22:55 -04:00
parent cb6dfd1656
commit f710c52bdc
8 changed files with 79 additions and 36 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ export function processSingleServerGrowth(server: Server, threads: number, p: IP
if (oldMoneyAvailable !== server.moneyAvailable) {
//Growing increases server security twice as much as hacking
let usedCycles = numCycleForGrowth(server, server.moneyAvailable / oldMoneyAvailable, p, cores);
usedCycles = Math.max(0, usedCycles);
usedCycles = Math.min(Math.max(0, usedCycles), threads);
server.fortify(2 * CONSTANTS.ServerFortifyAmount * Math.ceil(usedCycles));
}
return server.moneyAvailable / oldMoneyAvailable;