Core/BattlePets: Move BattlePet stuff from SpellMgr to BattlePetMgr (#27986)

This commit is contained in:
Meji
2022-06-09 13:58:54 +02:00
committed by GitHub
parent 0943610fde
commit a1f673d1ca
8 changed files with 31 additions and 17 deletions

View File

@@ -27,7 +27,6 @@
#include "NPCPackets.h"
#include "ObjectMgr.h"
#include "Player.h"
#include "SpellMgr.h"
#include "World.h"
void WorldSession::HandleSplitItemOpcode(WorldPackets::Item::SplitItem& splitItem)
@@ -1207,7 +1206,7 @@ void WorldSession::HandleUseCritterItem(WorldPackets::Item::UseCritterItem& useC
if (itemEffect->TriggerType != ITEM_SPELLTRIGGER_ON_LEARN)
continue;
if (BattlePetSpeciesEntry const* speciesEntry = sSpellMgr->GetBattlePetSpecies(uint32(itemEffect->SpellID)))
if (BattlePetSpeciesEntry const* speciesEntry = BattlePets::BattlePetMgr::GetBattlePetSpeciesBySpell(uint32(itemEffect->SpellID)))
GetBattlePetMgr()->AddPet(speciesEntry->ID, BattlePets::BattlePetMgr::SelectPetDisplay(speciesEntry),
BattlePets::BattlePetMgr::RollPetBreed(speciesEntry->ID), BattlePets::BattlePetMgr::GetDefaultPetQuality(speciesEntry->ID));
}