diff --git a/src/Constants.js b/src/Constants.js index 547bb046a..88a06b68d 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -514,6 +514,7 @@ let CONSTANTS = { * It is now possible to use freely use angled bracket (<, >) and create DOM elements using tprint() * The game's theme colors can now be set through the Terminal configuration (.fconf). * You can now switch to the old left-hand main menu bar through the Terminal configuration (.fconf) + * grow() percentage is no longer reported as Infinity when a server's money is grown from 0 to X ` } diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index 1fd6f1465..02015b587 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -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;