• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

boost attributes tfs 1.5 8.6 - crashing server

vexler222

Active Member
Joined
Apr 22, 2012
Messages
714
Solutions
15
Reaction score
46
Hi, i added boost attribute to tfs 1.5 8.6 (this: Adding features from #998 by nekiro · Pull Request #2807 · otland/forgottenserver (https://github.com/otland/forgottenserver/pull/2807/files) )
And now when monster attacking me server got crash
(i don't have items with boost attributes only with manaleech, without any item it not crashing)

Btw manaleech working and before not crashing server, only after added boost attributes

Im runing it by visual studio to get log, and it sending me here:
Code:
if (Player* attackerPlayer = attacker->getPlayer()) {
        for (int32_t slot = CONST_SLOT_FIRST; slot <= CONST_SLOT_LAST; ++slot) {
            if (!attackerPlayer->isItemAbilityEnabled(static_cast<slots_t>(slot))) {
                continue;
            }

            Item* item = attackerPlayer->getInventoryItem(static_cast<slots_t>(slot));
            if (!item) {
                continue;
            }

            const uint16_t boostPercent = item->getBoostPercent(combatType);
            if (boostPercent != 0) {
                damage += std::round(damage * (boostPercent / 100.));
            }
        }
    }

1656011293790.png
1656011328881.png
 
Hello guys. This is a lot hard to me, but boost pecent attributes are not showing:

C++:
modifier = item ? item->getBoostPercent(COMBAT_NONE) : it.abilities->boostPercent[0];
            show = modifier;
            if (show != 0) {
                for (size_t i = 1; i < COMBAT_COUNT; ++i) {
                    int16_t temp = item ? item->getReflect(indexToCombatType(i)).chance : it.abilities->reflect[i].chance;
                    if (temp != show) {
                        show = 0;
                        break;
                    }
                }
            }

            if (show == 0) {
                bool tmp = true;

                for (size_t i = 0; i < COMBAT_COUNT; ++i) {
                    modifier = item ? item->getBoostPercent(indexToCombatType(i)) : it.abilities->boostPercent[i];
                    if (modifier == 0) {
                        continue;
                    }

                    if (tmp) {
                        tmp = false;

                        if (begin) {
                            begin = false;
                            s << " (";
                        } else {
                            s << ", ";
                        }

                        s << "boost ";
                    } else {
                        s << ", ";
                    }

                    s << getCombatName(indexToCombatType(i)) << ' ' << std::showpos << modifier << std::noshowpos << '%';
                }
            } else {
                if (begin) {
                    begin = false;
                    s << " (";
                } else {
                    s << ", ";
                }

                s << "boost all " << std::showpos << show << std::noshowpos << '%';
            }


the boost works but dont show the boost percent right on look..

Lua:
item:setBoostPercent(total, item:getBoostPercent()+1)
print (item:getBoostPercent(total))

Can someone help me to solve that?
Thanks.
 
Back
Top