Merge branch 'dev' into patch-3

This commit is contained in:
Nikolai Korolev
2022-03-10 12:06:19 +03:00
committed by GitHub
69 changed files with 588 additions and 283 deletions
+2 -2
View File
@@ -1139,7 +1139,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
// Invalid file name
if (!scriptname.endsWith(".lit") && !isScriptFilename(scriptname) && !scriptname.endsWith("txt")) {
throw makeRuntimeErrorMsg("scp", "Only works for .script, .lit, and .txt files");
throw makeRuntimeErrorMsg("scp", "Only works for scripts, .lit and .txt files");
}
let destServer: BaseServer | null;
@@ -1646,7 +1646,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS {
return cost;
},
purchaseServer: function (aname: any, aram: any): any {
updateDynamicRam("purchaseServer", getRamCost(Player, "purchaseServer"));
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"));