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
https://metin2.dev/topic/16770-gamecore/
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.