mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 01:23:49 +01:00
Still addressing bug with loading offline progress
This commit is contained in:
parent
5c301487c0
commit
6c8457fcd8
@ -720,12 +720,13 @@ var Engine = {
|
||||
Engine._lastUpdate = new Date().getTime();
|
||||
var lastUpdate = Player.lastUpdate;
|
||||
var numCyclesOffline = Math.floor((Engine._lastUpdate - lastUpdate) / Engine._idleSpeed);
|
||||
Player.lastUpdate = new Date().getTime();
|
||||
|
||||
|
||||
/* Process offline progress */
|
||||
processServerGrowth(numCyclesOffline); //Should be done before offline production for scripts
|
||||
loadAllRunningScripts(); //This also takes care of offline production for those scripts
|
||||
if (Player.isWorking) {
|
||||
console.log("work() called in load() for " + numCyclesOffline * Engine._idleSpeed + " milliseconds");
|
||||
if (Player.workType == CONSTANTS.WorkTypeFaction) {
|
||||
Player.workForFaction(numCyclesOffline);
|
||||
} else if (Player.workType == CONSTANTS.WorkTypeCreateProgram) {
|
||||
@ -741,6 +742,8 @@ var Engine = {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Hacknet Nodes offline progress
|
||||
processAllHacknetNodeEarnings(numCyclesOffline);
|
||||
|
||||
@ -752,6 +755,7 @@ var Engine = {
|
||||
if (Player.totalPlaytime == null) {Player.totalPlaytime = 0;}
|
||||
Player.totalPlaytime += time;
|
||||
|
||||
Player.lastUpdate = Engine._lastUpdate;
|
||||
Engine.start(); //Run main game loop and Scripts loop
|
||||
} else {
|
||||
//No save found, start new game
|
||||
|
Loading…
Reference in New Issue
Block a user