mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/BattlePets: Misc fixes
* The battle pet's experience and level will now be reflected in the player's UpdateFields * Despawn summoned battle pet when it is caged
This commit is contained in:
@@ -46,15 +46,20 @@ void WorldSession::HandleDismissCritter(WorldPackets::Pet::DismissCritter& packe
|
||||
|
||||
if (!pet)
|
||||
{
|
||||
TC_LOG_DEBUG("entities.pet", "Vanitypet (%s) does not exist - player '%s' (%s / account: %u) attempted to dismiss it (possibly lagged out)",
|
||||
TC_LOG_DEBUG("entities.pet", "Critter (%s) does not exist - player '%s' (%s / account: %u) attempted to dismiss it (possibly lagged out)",
|
||||
packet.CritterGUID.ToString().c_str(), GetPlayer()->GetName().c_str(), GetPlayer()->GetGUID().ToString().c_str(), GetAccountId());
|
||||
return;
|
||||
}
|
||||
|
||||
if (_player->GetCritterGUID() == pet->GetGUID())
|
||||
{
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->IsSummon())
|
||||
pet->ToTempSummon()->UnSummon();
|
||||
if (pet->GetTypeId() == TYPEID_UNIT && pet->IsSummon())
|
||||
{
|
||||
if (!_player->GetSummonedBattlePetGUID().IsEmpty() && _player->GetSummonedBattlePetGUID() == pet->GetBattlePetCompanionGUID())
|
||||
_player->SetBattlePetData(nullptr);
|
||||
|
||||
pet->ToTempSummon()->UnSummon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user