From db5476ebd06c87fdddd18c361a682f46960dea9c Mon Sep 17 00:00:00 2001 From: SagePtr Date: Sun, 30 Jan 2022 00:04:45 +0200 Subject: [PATCH] Add user-friendly invalid argument number message to purchaseServer --- src/NetscriptFunctions.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index ae6cd479e..6ae6dddbd 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -1628,6 +1628,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { return cost; }, purchaseServer: function (aname: any, aram: any): any { + if (arguments.length !== 2) throw makeRuntimeErrorMsg("purchaseServer", "Takes 2 arguments"); const name = helper.string("purchaseServer", "name", aname); const ram = helper.number("purchaseServer", "ram", aram); updateDynamicRam("purchaseServer", getRamCost(Player, "purchaseServer"));