fix(Core/Pet): only show pet details for hunter pets and demons (#2637)

This commit is contained in:
Stoabrogga
2020-02-28 17:02:54 +01:00
committed by GitHub
parent 9adba482c2
commit 2eb0705668
2 changed files with 9 additions and 3 deletions

View File

@@ -2203,8 +2203,11 @@ void Pet::HandleAsynchLoadFailed(AsynchPetSummon* info, Player* player, uint8 as
if (info->m_petType == SUMMON_PET)
{
// this enables pet details window (Shift+P)
pet->GetCharmInfo()->SetPetNumber(pet_number, true);
if (pet->GetCreatureTemplate()->type == CREATURE_TYPE_DEMON)
pet->GetCharmInfo()->SetPetNumber(pet_number, true); // Show pet details tab (Shift+P) only for demons
else
pet->GetCharmInfo()->SetPetNumber(pet_number, false);
pet->SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
pet->SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
pet->SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, 1000);

View File

@@ -160,7 +160,10 @@ uint8 WorldSession::HandleLoadPetFromDBFirstCallback(PreparedQueryResult result,
return PET_LOAD_OK;
}
pet->GetCharmInfo()->SetPetNumber(pet_number, pet->IsPermanentPetFor(owner));
if (pet->getPetType() == HUNTER_PET || pet->GetCreatureTemplate()->type == CREATURE_TYPE_DEMON)
pet->GetCharmInfo()->SetPetNumber(pet_number, pet->IsPermanentPetFor(owner)); // Show pet details tab (Shift+P) only for hunter pets or demons
else
pet->GetCharmInfo()->SetPetNumber(pet_number, false);
pet->SetDisplayId(fields[3].GetUInt32());
pet->SetNativeDisplayId(fields[3].GetUInt32());