fix(Core/Pets): Improved Revive Pet should affect dead despawned pet. (#9625)

* fix(Core/Pets): Improved Revive Pet should affect dead despawned pet.

Fixes #9589
This commit is contained in:
UltraNix
2021-12-15 09:32:16 +01:00
committed by GitHub
parent 1cc9ea83ab
commit d87d0a2ae8
7 changed files with 24 additions and 14 deletions

View File

@@ -222,7 +222,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint8 asynchLoadType, uint32 petentry, ui
{
// process only if player is in world (teleport crashes?)
// otherwise wait with result till he logs in
uint8 loadResult = mySess->HandleLoadPetFromDBFirstCallback(result, asynchLoadType);
uint8 loadResult = mySess->HandleLoadPetFromDBFirstCallback(result, asynchLoadType, info);
if (loadResult != PET_LOAD_OK)
Pet::HandleAsynchLoadFailed(info, owner, asynchLoadType, loadResult);
@@ -2328,6 +2328,11 @@ void Pet::HandleAsynchLoadFailed(AsynchPetSummon* info, Player* player, uint8 as
//owner->PetSpellInitialize();
pet->SavePetToDB(PET_SAVE_AS_CURRENT, false);
}
if (info->m_healthPct)
{
pet->SetHealth(pet->CountPctFromMaxHealth(info->m_healthPct));
}
}
}