Jump to content

Recommended Posts

Hello, i have probleme with this fonction

void CHARACTER::BroadcastTargetPacket()
{
    if (m_set_pkChrTargetedBy.empty())
        return;

    TPacketGCTarget p;

    p.header = HEADER_GC_TARGET;
    p.dwVID = GetVID();

    if (IsPC())
        p.bHPPercent = 0;
    else
        p.bHPPercent = MINMAX(0, (GetHP() * 100) / GetMaxHP(), 100);

    CHARACTER_SET::iterator it = m_set_pkChrTargetedBy.begin();

    while (it != m_set_pkChrTargetedBy.end())
    {
        LPCHARACTER pkChr = *it++;

        if (!pkChr->GetDesc())
        {
            sys_err("%s %p does not have desc", pkChr->GetName(), get_pointer(pkChr));
            abort();
        }

        pkChr->GetDesc()->Packet(&p, sizeof(TPacketGCTarget));
    }
}

and

struct FuncWeaken
{
    LPCHARACTER m_pkGM;
    bool    m_bAll;

    FuncWeaken(LPCHARACTER ch) : m_pkGM(ch), m_bAll(false)
    {
    }

    void operator () (LPENTITY ent)
    {
        if (!ent->IsType(ENTITY_CHARACTER))
            return;

        LPCHARACTER pkChr = (LPCHARACTER) ent;

        int iDist = DISTANCE_APPROX(pkChr->GetX() - m_pkGM->GetX(), pkChr->GetY() - m_pkGM->GetY());

        if (!m_bAll && iDist >= 1000)    // 10¹ÌÅÍ ÀÌ»ó¿¡ ÀÖ´Â °ÍµéÀº purge ÇÏÁö ¾Ê´Â´Ù.
            return;

        if (pkChr->IsNPC())
            pkChr->PointChange(POINT_HP, (10 - pkChr->GetHP()));
    }
};

 

When the mob have 0 HP the server crash and  I would like to solve the problem, but I do not know how .

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



  • Similar Content

  • Activity

    1. 4

      Feeding game source to LLM

    2. 0

      Quest 6/7 Problem

    3. 5

      Effect weapons

    4. 0

      [C++] Fix Core Downer Using Negative Number in GM Codes

    5. 3

      Crystal Metinstone

    6. 4

      Feeding game source to LLM

    7. 113

      Ulthar SF V2 (TMP4 Base)

    8. 4

      Feeding game source to LLM

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.