mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-09-19 20:38:42 +02:00
Error calculating hacknet node earnings sets to 0 instead of throwing error
This commit is contained in:
parent
f211e8856f
commit
281aad993f
5
dist/bundle.js
vendored
5
dist/bundle.js
vendored
@ -44676,7 +44676,10 @@ function processAllHacknetNodeEarnings(numCycles) {
|
||||
function processSingleHacknetNodeEarnings(numCycles, nodeObj) {
|
||||
var cyclesPerSecond = 1000 / __WEBPACK_IMPORTED_MODULE_2__engine_js__["Engine"]._idleSpeed;
|
||||
var earningPerCycle = nodeObj.moneyGainRatePerSecond / cyclesPerSecond;
|
||||
if (isNaN(earningPerCycle)) {throw new Error("Calculated Earnings is not a number");}
|
||||
if (isNaN(earningPerCycle)) {
|
||||
console.log("ERROR: Hacknet Node Calculated earnings is NaN");
|
||||
earningPerCycle = 0;
|
||||
}
|
||||
var totalEarnings = numCycles * earningPerCycle;
|
||||
nodeObj.totalMoneyGenerated += totalEarnings;
|
||||
nodeObj.onlineTimeSeconds += (numCycles * (__WEBPACK_IMPORTED_MODULE_2__engine_js__["Engine"]._idleSpeed / 1000));
|
||||
|
@ -480,7 +480,10 @@ function processAllHacknetNodeEarnings(numCycles) {
|
||||
function processSingleHacknetNodeEarnings(numCycles, nodeObj) {
|
||||
var cyclesPerSecond = 1000 / Engine._idleSpeed;
|
||||
var earningPerCycle = nodeObj.moneyGainRatePerSecond / cyclesPerSecond;
|
||||
if (isNaN(earningPerCycle)) {throw new Error("Calculated Earnings is not a number");}
|
||||
if (isNaN(earningPerCycle)) {
|
||||
console.log("ERROR: Hacknet Node Calculated earnings is NaN");
|
||||
earningPerCycle = 0;
|
||||
}
|
||||
var totalEarnings = numCycles * earningPerCycle;
|
||||
nodeObj.totalMoneyGenerated += totalEarnings;
|
||||
nodeObj.onlineTimeSeconds += (numCycles * (Engine._idleSpeed / 1000));
|
||||
|
Loading…
Reference in New Issue
Block a user