diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index dfa931e6c..faafef35c 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -1631,7 +1631,12 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { const cost = getPurchaseServerCost(ram); if (cost === Infinity) { - workerScript.log("purchaseServer", () => `Invalid argument: ram='${ram}' must be a positive power of 2`); + if(ram > getPurchaseServerMaxRam()){ + workerScript.log("purchaseServer", () => `Invalid argument: ram='${ram}' must not be greater than getPurchaseServerMaxRam`); + }else{ + workerScript.log("purchaseServer", () => `Invalid argument: ram='${ram}' must be a positive power of 2`); + } + return ""; }