Fix issues with warning not displaying #619

This commit is contained in:
Daniël van Noord
2021-02-25 22:33:35 +01:00
parent 75bf3f5c17
commit 61a30c704f
3 changed files with 6 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1443,7 +1443,7 @@ CM.Disp.UpdateTooltipUpgrade = function () {
l('CMTooltipIncome').textContent = Beautify(CM.Disp.TooltipBonusIncome, 2); l('CMTooltipIncome').textContent = Beautify(CM.Disp.TooltipBonusIncome, 2);
const increase = Math.round(CM.Disp.TooltipBonusIncome / Game.cookiesPs * 10000); const increase = Math.round(CM.Disp.TooltipBonusIncome / Game.cookiesPs * 10000);
// Don't display certain parts of tooltip if not applicable // Don't display certain parts of tooltip if not applicable
if (l('CMTooltipIncome').textContent === '0') { if (l('CMTooltipIncome').textContent === '0' && (CM.Disp.tooltipType === 'b' || CM.Disp.tooltipType === 'u')) {
l('Bonus IncomeTitle').style.display = 'none'; l('Bonus IncomeTitle').style.display = 'none';
l('CMTooltipIncome').style.display = 'none'; l('CMTooltipIncome').style.display = 'none';
l('Payback PeriodTitle').style.display = 'none'; l('Payback PeriodTitle').style.display = 'none';
@@ -1540,10 +1540,10 @@ CM.Disp.UpdateTooltipGrimoire = function () {
} }
// Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0) // Extra information on cookies gained when spell is Conjure Baked Goods (Name === 0)
if (CM.Disp.tooltipName === 0) { if (CM.Disp.tooltipName === '0') {
tooltipBox.appendChild(CM.Disp.TooltipCreateHeader('Cookies to be gained/lost')); tooltipBox.appendChild(CM.Disp.TooltipCreateHeader('Cookies to be gained/lost'));
const conjure = document.createElement('div'); const conjure = document.createElement('div');
conjure.id = 'CMTooltipConjure'; conjure.id = 'x';
tooltipBox.appendChild(conjure); tooltipBox.appendChild(conjure);
const reward = document.createElement('span'); const reward = document.createElement('span');
reward.style.color = '#33FF00'; reward.style.color = '#33FF00';

View File

@@ -841,8 +841,8 @@ CM.Sim.CalculateChangeAura = function (aura) {
// Sell highest building but only if aura is different // Sell highest building but only if aura is different
let price = 0; let price = 0;
if (CM.Sim.dragonAura !== CM.Cache.dragonAura || CM.Sim.dragonAura2 !== CM.Cache.dragonAura2) { if (CM.Sim.dragonAura !== CM.Cache.dragonAura || CM.Sim.dragonAura2 !== CM.Cache.dragonAura2) {
for (let i = Game.ObjectsById.length; i > -1; --i) { for (let i = Game.ObjectsById.length - 1; i > -1; --i) {
if (Game.ObjectsById[i].amount > 0) { if (Game.ObjectsById[i - 1].amount > 0) {
const highestBuilding = CM.Sim.Objects[Game.ObjectsById[i].name].name; const highestBuilding = CM.Sim.Objects[Game.ObjectsById[i].name].name;
CM.Sim.Objects[highestBuilding].amount -= 1; CM.Sim.Objects[highestBuilding].amount -= 1;
CM.Sim.buildingsOwned -= 1; CM.Sim.buildingsOwned -= 1;