Jump to content
×
×
  • Create New...
  • 0

game.core


Tallywa

Question

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

  • Answers 2
  • Created
  • Last Reply

Top Posters For This Question

Popular Days

Top Posters For This Question

2 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


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.