fix(Core/Pets): fixed crash happening when current pet is forcibly removed (#10025)

This commit is contained in:
Kargatum
2022-01-10 19:19:43 +07:00
committed by GitHub
parent b2df4aa970
commit c1ebda66ba
8 changed files with 50 additions and 10 deletions

View File

@@ -948,7 +948,7 @@ void WorldSession::HandlePetAbandon(WorldPacket& recvData)
pet->SetPower(POWER_HAPPINESS, feelty > 50000 ? (feelty - 50000) : 0);
}
_player->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED);
_player->RemovePet(pet->ToPet(), PET_SAVE_AS_DELETED);
}
else if (pet->GetGUID() == _player->GetCharmGUID())
_player->StopCastingCharm();