mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8119] Speedup code and prevent crash at pet stats reset in time owner not in world.
This commit is contained in:
parent
0e1d03baeb
commit
8d2dab1093
2 changed files with 9 additions and 6 deletions
|
|
@ -1459,13 +1459,16 @@ bool Pet::unlearnSpell(uint32 spell_id, bool learn_prev, bool clear_ab)
|
||||||
{
|
{
|
||||||
if(removeSpell(spell_id,learn_prev,clear_ab))
|
if(removeSpell(spell_id,learn_prev,clear_ab))
|
||||||
{
|
{
|
||||||
if(GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
if(!m_loading)
|
||||||
{
|
{
|
||||||
if(!m_loading)
|
if (Unit* owner = GetOwner())
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_PET_REMOVED_SPELL, 4);
|
if(owner->GetTypeId() == TYPEID_PLAYER)
|
||||||
data << uint32(spell_id);
|
{
|
||||||
((Player*)GetOwner())->GetSession()->SendPacket(&data);
|
WorldPacket data(SMSG_PET_REMOVED_SPELL, 4);
|
||||||
|
data << uint32(spell_id);
|
||||||
|
((Player*)owner)->GetSession()->SendPacket(&data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8118"
|
#define REVISION_NR "8119"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue