mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[10754] Use UNIT_FIELD_CRITTER for store minipet guid.
Also move related code to Unit and allow summon minipets by creatures. Signed-off-by: VladimirMangos <vladimir@getmangos.com> Also fix creature's totems unsummon at owner remove from world.
This commit is contained in:
parent
f671f09950
commit
92ed528eb9
7 changed files with 35 additions and 45 deletions
|
|
@ -1489,9 +1489,6 @@ void Player::SetDeathState(DeathState s)
|
|||
//FIXME: is pet dismissed at dying or releasing spirit? if second, add SetDeathState(DEAD) to HandleRepopRequestOpcode and define pet unsummon here with (s == DEAD)
|
||||
RemovePet(PET_SAVE_REAGENTS);
|
||||
|
||||
// remove uncontrolled pets
|
||||
RemoveMiniPet();
|
||||
|
||||
// save value before aura remove in Unit::SetDeathState
|
||||
ressSpellId = GetUInt32Value(PLAYER_SELF_RES_SPELL);
|
||||
|
||||
|
|
@ -2015,14 +2012,6 @@ void Player::AddToWorld()
|
|||
|
||||
void Player::RemoveFromWorld()
|
||||
{
|
||||
// cleanup
|
||||
if(IsInWorld())
|
||||
{
|
||||
///- Release charmed creatures, unsummon totems and remove pets/guardians
|
||||
UnsummonAllTotems();
|
||||
RemoveMiniPet();
|
||||
}
|
||||
|
||||
for(int i = PLAYER_SLOT_START; i < PLAYER_SLOT_END; ++i)
|
||||
{
|
||||
if(m_items[i])
|
||||
|
|
@ -17788,20 +17777,6 @@ void Player::RemovePet(PetSaveMode mode)
|
|||
pet->Unsummon(mode, this);
|
||||
}
|
||||
|
||||
void Player::RemoveMiniPet()
|
||||
{
|
||||
if (Pet* pet = GetMiniPet())
|
||||
pet->Unsummon(PET_SAVE_AS_DELETED);
|
||||
}
|
||||
|
||||
Pet* Player::GetMiniPet() const
|
||||
{
|
||||
if (m_miniPetGuid.IsEmpty())
|
||||
return NULL;
|
||||
|
||||
return GetMap()->GetPet(m_miniPetGuid);
|
||||
}
|
||||
|
||||
void Player::BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string& text, uint32 language) const
|
||||
{
|
||||
*data << (uint8)msgtype;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue