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)
This commit is contained in:
@@ -676,20 +676,15 @@ void WorldSession::HandlePetAbandon(WorldPacket& recvData)
|
||||
|
||||
// pet/charmed
|
||||
Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*_player, guid);
|
||||
if (pet)
|
||||
if (pet && pet->ToPet() && pet->ToPet()->getPetType() == HUNTER_PET)
|
||||
{
|
||||
if (pet->IsPet())
|
||||
if (pet->GetGUID() == _player->GetPetGUID())
|
||||
{
|
||||
if (pet->GetGUID() == _player->GetPetGUID())
|
||||
{
|
||||
uint32 feelty = pet->GetPower(POWER_HAPPINESS);
|
||||
pet->SetPower(POWER_HAPPINESS, feelty > 50000 ? (feelty-50000) : 0);
|
||||
}
|
||||
|
||||
_player->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED);
|
||||
uint32 feelty = pet->GetPower(POWER_HAPPINESS);
|
||||
pet->SetPower(POWER_HAPPINESS, feelty > 50000 ? (feelty-50000) : 0);
|
||||
}
|
||||
else if (pet->GetGUID() == _player->GetCharmGUID())
|
||||
_player->StopCastingCharm();
|
||||
|
||||
_player->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user