mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 18:50:56 +02:00
Error calculating hacknet node earnings sets to 0 instead of throwing error
This commit is contained in:
+4
-1
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user