[C++] CHARACTER::Sync Renewal (Cannot Find Tree FIX)

  • INTRODUCTION & PROBLEM


    Hello, we will solve the famous "Cannot Find Tree" problem in the "CHARACTER::Sync" function in the server src and also the problems that may be caused by the "Dead();" section used for everything that is not a PC in this function.


    WHAT DID WE CHANGE?


    All of the currently shared fixes are actually incomplete, we will make a new arrangement to solve this problem at its root, thus we will fix the problem completely.


    HOW TO DO?


    Without going into details such as editing the reward mechanism of the existing dead function, we will simply create a new dead function and use it in Sync. The main purpose of this function, which can only be used for mobs and metins, is that it does not give a reward (drop) after the dead function, let's get started.


    UPDATE - 23/10/2024


    I fixed a code that caused the (!new_tree) part of the function to return false under all circumstances also added all the nullptr checks and extra sys_err messages where necessary, expanded the content of the existing sys_err messages, these changes will not cause any performance disadvantages and there is no possibility of it being misused in any way anymore, please use the final version.


    First, open "char_battle.cpp"


    Then open "char.cpp"

    Lastly, open "char.h"

    Code
    1. // Find;
    2. void Dead (LPCHARACTER pkKiller = NULL, bool bImmediateDead = false);
    3. // Add under;
    4. void RewardlessDead(); // DevFix 29

    Best regards, MT2Dev.

    Bitte melden Sie sich an, um dieses Bild zu sehen.


    ©

    2 Mal editiert, zuletzt von MT2Dev () aus folgendem Grund: Last Update.

  • Dieses Thema enthält einen weiteren Beitrag, der nur für registrierte Benutzer sichtbar ist, bitte registrieren Sie sich oder melden Sie sich an um diesen lesen zu können.