mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Pets: Fixed exploit where warlock can abandon its pet to generate new name (#18606)
(cherry-picked from 8ce5712552)
This commit is contained in:
@@ -592,13 +592,11 @@ void WorldSession::HandlePetAbandon(WorldPackets::Pet::PetAbandon& packet)
|
||||
if (!_player->IsInWorld())
|
||||
return;
|
||||
|
||||
// pet/charmed
|
||||
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, packet.Pet);
|
||||
if (pet)
|
||||
if (pet && pet->ToPet() && pet->ToPet()->getPetType() == HUNTER_PET)
|
||||
{
|
||||
if (pet->IsPet())
|
||||
_player->RemovePet(pet->ToPet(), PET_SAVE_AS_DELETED);
|
||||
else if (pet->GetGUID() == _player->GetCharmGUID())
|
||||
_player->StopCastingCharm();
|
||||
_player->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user