Fixed bug with Hacknet Nodes production not updating initially. FIxed bug with 'purchase augmentations' btn being displayed for Gang BitNode

This commit is contained in:
danielyxie
2019-02-26 15:59:22 -08:00
committed by danielyxie
parent 3d76390c2c
commit ddfae56e34
5 changed files with 60 additions and 51 deletions
+8
View File
@@ -562,6 +562,14 @@ PlayerObject.prototype.canAfford = function(cost) {
}
PlayerObject.prototype.recordMoneySource = function(amt, source) {
if (!(this.moneySourceA instanceof MoneySourceTracker)) {
console.warn(`Player.moneySourceA was not properly initialized. Resetting`);
this.moneySourceA = new MoneySourceTracker();
}
if (!(this.moneySourceB instanceof MoneySourceTracker)) {
console.warn(`Player.moneySourceB was not properly initialized. Resetting`);
this.moneySourceB = new MoneySourceTracker();
}
this.moneySourceA.record(amt, source);
this.moneySourceB.record(amt, source);
}