From 3f5398f8dc236fbf7b24c7f5ef59c3af36b5f5e6 Mon Sep 17 00:00:00 2001 From: James Aguilar <799564+jaguilar@users.noreply.github.com> Date: Sun, 6 May 2018 09:23:07 -0400 Subject: [PATCH] Fix purchaseServer's use of new Server() --- src/NetscriptFunctions.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index 799ca02df..b5844e419 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -1633,7 +1633,15 @@ function NetscriptFunctions(workerScript) { workerScript.scriptRef.log("Error: Not enough money to purchase server. Need $" + formatNumber(cost, 2)); return ""; } - var newServ = new Server(createRandomIp(), hostnameStr, "", false, true, true, ram); + var newServ = new Server({ + ip: createRandomIp(), + hostname: hostnameStr, + organizationName: "", + isConnectedTo: false, + adminRights: true, + purchasedByPlayer: true, + maxRam: ram, + }); AddToAllServers(newServ); Player.purchasedServers.push(newServ.ip);