grow() no longer reports Infinite growth when money is at 0

This commit is contained in:
danielyxie
2018-09-27 21:09:02 -05:00
parent 561cdb1652
commit 11c60a87c2
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -421,7 +421,7 @@ function NetscriptFunctions(workerScript) {
}
return netscriptDelay(growTime * 1000, workerScript).then(function() {
if (workerScript.env.stopFlag) {return Promise.reject(workerScript);}
const moneyBefore = server.moneyAvailable;
const moneyBefore = server.moneyAvailable <= 0 ? 1 : server.moneyAvailable;
server.moneyAvailable += (1 * threads); //It can be grown even if it has no money
var growthPercentage = processSingleServerGrowth(server, 450 * threads);
const moneyAfter = server.moneyAvailable;