Broken market & fix

About: Harem Heroes++ modified by 1121

I don't know what's going on hentai heroes et al. but nutaku version does not provide Hero.infos.items array property anymore so the market code throws an exception. And well it doesn't work.

Search for market section, the function is called "ModifyMarket".
There is a nested function "updateStats".

Add the next code after that function:

function parseEquipStat(carac) {
    var arrDivEquippedItems = $('div#equiped>div.armor>div.slot').toArray();
    var iCaracPoints = 0;

    arrDivEquippedItems.forEach(function(item) {
        let oData = JSON.parse(item.dataset.d);
        let iItemCaracPoints = oData[carac];
        iCaracPoints += iItemCaracPoints;

    return iCaracPoints;

Now inside the "updateStats" change the line:
itemPoints = Hero.infos.items[stat],
so as to execute our new code:
itemPoints = parseEquipStat(stat),


Connectez-vous ou Inscrivez-vous pour répondre.