Fixed bug with offline progress, hopefully. LastUpdate time wasnt being saved properly

This commit is contained in:
Daniel Xie
2017-05-15 15:12:19 -05:00
parent 6c8457fcd8
commit 64717c7915
+1 -4
View File
@@ -516,9 +516,9 @@ var Engine = {
if (diff > 0) {
//Update the game engine by the calculated number of cycles
Engine.updateGame(diff);
Engine._lastUpdate = _thisUpdate - offset;
Player.lastUpdate = _thisUpdate - offset;
Engine.updateGame(diff);
}
window.requestAnimationFrame(Engine.idleTimer);
@@ -721,7 +721,6 @@ var Engine = {
var lastUpdate = Player.lastUpdate;
var numCyclesOffline = Math.floor((Engine._lastUpdate - lastUpdate) / Engine._idleSpeed);
/* Process offline progress */
processServerGrowth(numCyclesOffline); //Should be done before offline production for scripts
loadAllRunningScripts(); //This also takes care of offline production for those scripts
@@ -742,8 +741,6 @@ var Engine = {
}
}
//Hacknet Nodes offline progress
processAllHacknetNodeEarnings(numCyclesOffline);