• 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!
  • If you're using Gesior 2012 or MyAAC, please review this thread for information about a serious security vulnerability and a fix.

boost attributes tfs 1.5 8.6 - crashing server

vexler222

Member
Joined
Apr 22, 2012
Messages
618
Solutions
13
Reaction score
23
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
 
Top