mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/BattlePets: Fixes when adding pets (#27076)
* Add pet when learning it for the first time (summon spell not known). * Removed code that adds battle pet if its summon spell is known (Learn cageable pet -> Cage pet -> Log out -> Log in -> Pet is added). * When uncaging check that the species has a summon spell before trying to learn it.
This commit is contained in:
@@ -1206,11 +1206,8 @@ void WorldSession::HandleUseCritterItem(WorldPackets::Item::UseCritterItem& useC
|
||||
if (itemEffect->TriggerType != ITEM_SPELLTRIGGER_LEARN_SPELL_ID)
|
||||
continue;
|
||||
|
||||
if (BattlePetSpeciesEntry const* entry = sSpellMgr->GetBattlePetSpecies(uint32(itemEffect->SpellID)))
|
||||
{
|
||||
GetBattlePetMgr()->AddPet(entry->ID, BattlePetMgr::SelectPetDisplay(entry), BattlePetMgr::RollPetBreed(entry->ID), BattlePetMgr::GetDefaultPetQuality(entry->ID));
|
||||
_player->UpdateCriteria(CriteriaType::UniquePetsOwned);
|
||||
}
|
||||
if (BattlePetSpeciesEntry const* speciesEntry = sSpellMgr->GetBattlePetSpecies(uint32(itemEffect->SpellID)))
|
||||
GetBattlePetMgr()->AddPet(speciesEntry->ID, BattlePetMgr::SelectPetDisplay(speciesEntry), BattlePetMgr::RollPetBreed(speciesEntry->ID), BattlePetMgr::GetDefaultPetQuality(speciesEntry->ID));
|
||||
}
|
||||
|
||||
_player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
|
||||
|
||||
Reference in New Issue
Block a user