mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 09:33:49 +01:00
Merge pull request #2873 from SagePtr/purchaseserver-args
Add user-friendly invalid argument number message to purchaseServer
This commit is contained in:
commit
570b8caf78
@ -1628,6 +1628,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
|
|||||||
return cost;
|
return cost;
|
||||||
},
|
},
|
||||||
purchaseServer: function (aname: any, aram: any): any {
|
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 name = helper.string("purchaseServer", "name", aname);
|
||||||
const ram = helper.number("purchaseServer", "ram", aram);
|
const ram = helper.number("purchaseServer", "ram", aram);
|
||||||
updateDynamicRam("purchaseServer", getRamCost(Player, "purchaseServer"));
|
updateDynamicRam("purchaseServer", getRamCost(Player, "purchaseServer"));
|
||||||
|
Loading…
Reference in New Issue
Block a user