Fix building tooltip in sell mode (#359)
This commit is contained in:
15
src/Disp.js
15
src/Disp.js
@@ -2079,12 +2079,15 @@ CM.Disp.Tooltip = function(type, name) {
|
||||
}
|
||||
}
|
||||
else if (Game.buyMode == -1) {
|
||||
if (Game.buyBulk == -1) {
|
||||
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join('-' + Beautify(CM.Sim.BuildingSell(Game.Objects[name], Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.Objects[name].amount)));
|
||||
}
|
||||
else {
|
||||
l('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].getPrice())).join('-' + Beautify(CM.Sim.BuildingSell(Game.Objects[name], Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.buyBulk)));
|
||||
}
|
||||
/*
|
||||
* Fix sell price displayed in the object tooltip.
|
||||
*
|
||||
* 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('tooltip').innerHTML = l('tooltip').innerHTML.split(Beautify(Game.Objects[name].bulkPrice)).join(Beautify(CM.Sim.BuildingSell(Game.Objects[name], Game.Objects[name].basePrice, Game.Objects[name].amount, Game.Objects[name].free, Game.buyBulk, 1)));
|
||||
}
|
||||
}
|
||||
else if (type == 'u') {
|
||||
|
||||
Reference in New Issue
Block a user