diff --git a/CookieMonster.js b/CookieMonster.js index c945cf9..f4b5c38 100644 --- a/CookieMonster.js +++ b/CookieMonster.js @@ -1424,7 +1424,17 @@ CM.Disp.UpdateBuildings = function() { } else { for (var i in CM.Cache.Objects) { - l('productPrice' + Game.Objects[i].id).style.color = ''; + var o = Game.Objects[i]; + l('productPrice' + o.id).style.color = ''; + /* + * Fix sell price displayed in the object in the store. + * + * The buildings sell price displayed by the game itself (without any mod) is incorrect. + * The following line of code fixes this issue, and can be safely removed when the game gets fixed. + * + * This issue is extensively detailed here: https://github.com/Aktanusa/CookieMonster/issues/359#issuecomment-735658262 + */ + l('productPrice' + o.id).innerHTML = Beautify(CM.Sim.BuildingSell(o, o.basePrice, o.amount, o.free, Game.buyBulk, 1)); } } diff --git a/src/Disp.js b/src/Disp.js index be7b31b..e32aab0 100644 --- a/src/Disp.js +++ b/src/Disp.js @@ -676,7 +676,17 @@ CM.Disp.UpdateBuildings = function() { } else { for (var i in CM.Cache.Objects) { - l('productPrice' + Game.Objects[i].id).style.color = ''; + var o = Game.Objects[i]; + l('productPrice' + o.id).style.color = ''; + /* + * Fix sell price displayed in the object in the store. + * + * The buildings sell price displayed by the game itself (without any mod) is incorrect. + * The following line of code fixes this issue, and can be safely removed when the game gets fixed. + * + * This issue is extensively detailed here: https://github.com/Aktanusa/CookieMonster/issues/359#issuecomment-735658262 + */ + l('productPrice' + o.id).innerHTML = Beautify(CM.Sim.BuildingSell(o, o.basePrice, o.amount, o.free, Game.buyBulk, 1)); } }