Merge pull request #226 from jaguilar/fix-server-purchasing

Fix server purchasing
This commit is contained in:
danielyxie 2018-05-06 15:37:54 -05:00 committed by GitHub
commit 4429e4621d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);