mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-23 06:32:26 +01:00
Fixed bug with purchasing Hacknet Servers not updating hash capacity when done through Netscript
This commit is contained in:
parent
c566c838be
commit
b6b6d8e9fa
@ -75,6 +75,7 @@ export function purchaseHacknet() {
|
|||||||
}
|
}
|
||||||
/* END INTERACTIVE TUTORIAL */
|
/* END INTERACTIVE TUTORIAL */
|
||||||
|
|
||||||
|
const numOwned = Player.hacknetNodes.length;
|
||||||
if (hasHacknetServers()) {
|
if (hasHacknetServers()) {
|
||||||
const cost = getCostOfNextHacknetServer();
|
const cost = getCostOfNextHacknetServer();
|
||||||
if (isNaN(cost)) {
|
if (isNaN(cost)) {
|
||||||
@ -84,6 +85,7 @@ export function purchaseHacknet() {
|
|||||||
if (!Player.canAfford(cost)) { return -1; }
|
if (!Player.canAfford(cost)) { return -1; }
|
||||||
Player.loseMoney(cost);
|
Player.loseMoney(cost);
|
||||||
const server = createHacknetServer();
|
const server = createHacknetServer();
|
||||||
|
Player.hashManager.updateCapacity(Player);
|
||||||
|
|
||||||
return numOwned;
|
return numOwned;
|
||||||
} else {
|
} else {
|
||||||
@ -95,7 +97,6 @@ export function purchaseHacknet() {
|
|||||||
if (!Player.canAfford(cost)) { return -1; }
|
if (!Player.canAfford(cost)) { return -1; }
|
||||||
|
|
||||||
// Auto generate a name for the Node
|
// Auto generate a name for the Node
|
||||||
const numOwned = Player.hacknetNodes.length;
|
|
||||||
const name = "hacknet-node-" + numOwned;
|
const name = "hacknet-node-" + numOwned;
|
||||||
const node = new HacknetNode(name);
|
const node = new HacknetNode(name);
|
||||||
node.updateMoneyGainRate(Player);
|
node.updateMoneyGainRate(Player);
|
||||||
|
@ -89,7 +89,6 @@ export class HacknetRoot extends React.Component {
|
|||||||
const purchaseOnClick = () => {
|
const purchaseOnClick = () => {
|
||||||
if (purchaseHacknet() >= 0) {
|
if (purchaseHacknet() >= 0) {
|
||||||
this.recalculateTotalProduction();
|
this.recalculateTotalProduction();
|
||||||
Player.hashManager.updateCapacity(Player);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user