*Fix some client issues about pet.
--HG-- branch : trunk
This commit is contained in:
+6
-4
@@ -210,8 +210,6 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
|||||||
}
|
}
|
||||||
|
|
||||||
owner->SetPet(this, true);
|
owner->SetPet(this, true);
|
||||||
AIM_Initialize();
|
|
||||||
map->Add((Creature*)this);
|
|
||||||
|
|
||||||
InitStatsForLevel(petlevel);
|
InitStatsForLevel(petlevel);
|
||||||
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
|
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, time(NULL));
|
||||||
@@ -314,6 +312,9 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
|
|||||||
|
|
||||||
sLog.outDebug("New Pet has guid %u", GetGUIDLow());
|
sLog.outDebug("New Pet has guid %u", GetGUIDLow());
|
||||||
|
|
||||||
|
AIM_Initialize();
|
||||||
|
map->Add((Creature*)this);
|
||||||
|
|
||||||
if(owner->GetTypeId() == TYPEID_PLAYER)
|
if(owner->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
((Player*)owner)->PetSpellInitialize();
|
((Player*)owner)->PetSpellInitialize();
|
||||||
@@ -1362,8 +1363,8 @@ bool Pet::learnSpell(uint32 spell_id)
|
|||||||
WorldPacket data(SMSG_PET_LEARNED_SPELL, 2);
|
WorldPacket data(SMSG_PET_LEARNED_SPELL, 2);
|
||||||
data << uint16(spell_id);
|
data << uint16(spell_id);
|
||||||
((Player*)owner)->GetSession()->SendPacket(&data);
|
((Player*)owner)->GetSession()->SendPacket(&data);
|
||||||
|
((Player*)owner)->PetSpellInitialize();
|
||||||
}
|
}
|
||||||
((Player*)owner)->PetSpellInitialize();
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1603,7 +1604,8 @@ bool Pet::resetTalents(bool no_cost)
|
|||||||
m_resetTalentsCost = cost;
|
m_resetTalentsCost = cost;
|
||||||
m_resetTalentsTime = time(NULL);
|
m_resetTalentsTime = time(NULL);
|
||||||
}
|
}
|
||||||
player->PetSpellInitialize();
|
if(!m_loading)
|
||||||
|
player->PetSpellInitialize();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -8273,7 +8273,7 @@ Pet* Unit::GetPet() const
|
|||||||
return pet;
|
return pet;
|
||||||
|
|
||||||
sLog.outError("Unit::GetPet: Pet %u not exist.",GUID_LOPART(pet_guid));
|
sLog.outError("Unit::GetPet: Pet %u not exist.",GUID_LOPART(pet_guid));
|
||||||
const_cast<Unit*>(this)->SetUInt64Value(UNIT_FIELD_SUMMON, 0);
|
//const_cast<Unit*>(this)->SetUInt64Value(UNIT_FIELD_SUMMON, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user