mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-30 03:23:48 +01:00
convert a few variables to const.
This commit is contained in:
parent
1fbb971d6f
commit
5c92360310
@ -608,9 +608,9 @@ const Engine = {
|
|||||||
// Main Game Loop
|
// Main Game Loop
|
||||||
idleTimer: function() {
|
idleTimer: function() {
|
||||||
// Get time difference
|
// Get time difference
|
||||||
var _thisUpdate = new Date().getTime();
|
const _thisUpdate = new Date().getTime();
|
||||||
var diff = _thisUpdate - Engine._lastUpdate;
|
let diff = _thisUpdate - Engine._lastUpdate;
|
||||||
var offset = diff % Engine._idleSpeed;
|
const offset = diff % Engine._idleSpeed;
|
||||||
|
|
||||||
// Divide this by cycle time to determine how many cycles have elapsed since last update
|
// Divide this by cycle time to determine how many cycles have elapsed since last update
|
||||||
diff = Math.floor(diff / Engine._idleSpeed);
|
diff = Math.floor(diff / Engine._idleSpeed);
|
||||||
@ -626,7 +626,7 @@ const Engine = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
updateGame: function(numCycles = 1) {
|
updateGame: function(numCycles = 1) {
|
||||||
var time = numCycles * Engine._idleSpeed;
|
const time = numCycles * Engine._idleSpeed;
|
||||||
if (Player.totalPlaytime == null) {Player.totalPlaytime = 0;}
|
if (Player.totalPlaytime == null) {Player.totalPlaytime = 0;}
|
||||||
if (Player.playtimeSinceLastAug == null) {Player.playtimeSinceLastAug = 0;}
|
if (Player.playtimeSinceLastAug == null) {Player.playtimeSinceLastAug = 0;}
|
||||||
if (Player.playtimeSinceLastBitnode == null) {Player.playtimeSinceLastBitnode = 0;}
|
if (Player.playtimeSinceLastBitnode == null) {Player.playtimeSinceLastBitnode = 0;}
|
||||||
|
Loading…
Reference in New Issue
Block a user