Bug #221 Fix / Patch

Post Reply
User avatar
atom0s
Developer
Posts: 537
Joined: Thu Oct 25, 2012 9:52 am

Bug #221 Fix / Patch

Post by atom0s » Mon Jun 03, 2013 5:36 am

Bug Report: http://bugs.dspt.info/show_bug.cgi?id=221

Debugged this a bit, figured out that mob:checkBaseExp() is the cause and returns false if your pet does the killing and you have no enmity on the target.

Following this, the line: (lua_baseentity.cpp Line: 6227)

Code: Select all

uint32 baseexp = charutils::GetRealExp(PMob->m_HiPCLvl, PMob->GetMLevel());
Has the issue that PMob->m_HiPCLvl is 0 from the pet killing the target. This is because the pet AI does not update the targets highest PC level that was attacking it. This can be fixed with:

Code: Select all

            CMobEntity* Monster = (CMobEntity*)m_PBattleTarget;
            if (Monster->m_HiPCLvl < ((CCharEntity*)m_PPet->PMaster)->GetMLevel())
                Monster->m_HiPCLvl = ((CCharEntity*)m_PPet->PMaster)->GetMLevel();
Attachments
ai_pet_dummy.cpp.patch
(565 Bytes) Downloaded 258 times

PrBlahBlahtson
Developer
Posts: 539
Joined: Sun Jul 22, 2012 12:17 am

Re: Bug #221 Fix / Patch

Post by PrBlahBlahtson » Mon Jun 03, 2013 4:10 pm

Looks simple enough. Examining this.

Edit:
Committed as r3448 :)

Post Reply