aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/BattlePets/BattlePetMgr.cpp20
-rw-r--r--src/server/game/BattlePets/BattlePetMgr.h30
-rw-r--r--src/server/game/Entities/Creature/Trainer.cpp3
-rw-r--r--src/server/game/Entities/Player/Player.cpp17
-rw-r--r--src/server/game/Entities/Player/Player.h8
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp2
-rw-r--r--src/server/game/Handlers/BattlePetHandler.cpp14
-rw-r--r--src/server/game/Handlers/ItemHandler.cpp3
-rw-r--r--src/server/game/Server/WorldSession.cpp2
-rw-r--r--src/server/game/Server/WorldSession.h10
-rw-r--r--src/server/game/Spells/SpellEffects.cpp17
-rw-r--r--src/server/game/World/World.cpp2
12 files changed, 71 insertions, 57 deletions
diff --git a/src/server/game/BattlePets/BattlePetMgr.cpp b/src/server/game/BattlePets/BattlePetMgr.cpp
index dbb408325dc..c9166d86a02 100644
--- a/src/server/game/BattlePets/BattlePetMgr.cpp
+++ b/src/server/game/BattlePets/BattlePetMgr.cpp
@@ -31,7 +31,17 @@
#include "World.h"
#include "WorldSession.h"
-void BattlePetMgr::BattlePet::CalculateStats()
+namespace BattlePets
+{
+namespace
+{
+std::unordered_map<uint16 /*BreedID*/, std::unordered_map<BattlePetState /*state*/, int32 /*value*/, std::hash<std::underlying_type<BattlePetState>::type> >> _battlePetBreedStates;
+std::unordered_map<uint32 /*SpeciesID*/, std::unordered_map<BattlePetState /*state*/, int32 /*value*/, std::hash<std::underlying_type<BattlePetState>::type> >> _battlePetSpeciesStates;
+std::unordered_map<uint32 /*SpeciesID*/, std::unordered_set<uint8 /*breed*/>> _availableBreedsPerSpecies;
+std::unordered_map<uint32 /*SpeciesID*/, uint8 /*quality*/> _defaultQualityPerSpecies;
+}
+
+void BattlePet::CalculateStats()
{
float health = 0.0f;
float power = 0.0f;
@@ -80,11 +90,6 @@ void BattlePetMgr::BattlePet::CalculateStats()
PacketInfo.Speed = uint32(round(speed / 100));
}
-std::unordered_map<uint16 /*BreedID*/, std::unordered_map<BattlePetState /*state*/, int32 /*value*/, std::hash<std::underlying_type<BattlePetState>::type> >> BattlePetMgr::_battlePetBreedStates;
-std::unordered_map<uint32 /*SpeciesID*/, std::unordered_map<BattlePetState /*state*/, int32 /*value*/, std::hash<std::underlying_type<BattlePetState>::type> >> BattlePetMgr::_battlePetSpeciesStates;
-std::unordered_map<uint32 /*SpeciesID*/, std::unordered_set<uint8 /*breed*/>> BattlePetMgr::_availableBreedsPerSpecies;
-std::unordered_map<uint32 /*SpeciesID*/, uint8 /*quality*/> BattlePetMgr::_defaultQualityPerSpecies;
-
void BattlePetMgr::Initialize()
{
if (QueryResult result = LoginDatabase.Query("SELECT MAX(guid) FROM battle_pets"))
@@ -414,7 +419,7 @@ void BattlePetMgr::SaveToDB(LoginDatabaseTransaction& trans)
}
}
-BattlePetMgr::BattlePet* BattlePetMgr::GetPet(ObjectGuid guid)
+BattlePet* BattlePetMgr::GetPet(ObjectGuid guid)
{
return Trinity::Containers::MapGetValuePtr(_pets, guid.GetCounter());
}
@@ -741,3 +746,4 @@ bool BattlePetMgr::IsJournalLockAcquired() const
{
return sWorld->IsBattlePetJournalLockAcquired(_owner->GetBattlenetAccountGUID());
}
+}
diff --git a/src/server/game/BattlePets/BattlePetMgr.h b/src/server/game/BattlePets/BattlePetMgr.h
index 6fa7f588863..7a80e82aee8 100644
--- a/src/server/game/BattlePets/BattlePetMgr.h
+++ b/src/server/game/BattlePets/BattlePetMgr.h
@@ -25,6 +25,8 @@
struct BattlePetSpeciesEntry;
+namespace BattlePets
+{
enum BattlePetMisc
{
DEFAULT_MAX_BATTLE_PETS_PER_SPECIES = 3,
@@ -123,19 +125,19 @@ enum BattlePetSaveInfo
BATTLE_PET_REMOVED = 3
};
-class BattlePetMgr
+struct BattlePet
{
-public:
- struct BattlePet
- {
- void CalculateStats();
+ void CalculateStats();
- WorldPackets::BattlePet::BattlePet PacketInfo;
- time_t NameTimestamp = time_t(0);
- std::unique_ptr<::DeclinedName> DeclinedName;
- BattlePetSaveInfo SaveInfo = BATTLE_PET_UNCHANGED;
- };
+ WorldPackets::BattlePet::BattlePet PacketInfo;
+ time_t NameTimestamp = time_t(0);
+ std::unique_ptr<::DeclinedName> DeclinedName;
+ BattlePetSaveInfo SaveInfo = BATTLE_PET_UNCHANGED;
+};
+class BattlePetMgr
+{
+public:
explicit BattlePetMgr(WorldSession* owner);
static void Initialize();
@@ -193,12 +195,6 @@ private:
static void LoadAvailablePetBreeds();
static void LoadDefaultPetQualities();
-
- // hash no longer required in C++14
- static std::unordered_map<uint16 /*BreedID*/, std::unordered_map<BattlePetState /*state*/, int32 /*value*/, std::hash<std::underlying_type<BattlePetState>::type> >> _battlePetBreedStates;
- static std::unordered_map<uint32 /*SpeciesID*/, std::unordered_map<BattlePetState /*state*/, int32 /*value*/, std::hash<std::underlying_type<BattlePetState>::type> >> _battlePetSpeciesStates;
- static std::unordered_map<uint32 /*SpeciesID*/, std::unordered_set<uint8 /*breed*/>> _availableBreedsPerSpecies;
- static std::unordered_map<uint32 /*SpeciesID*/, uint8 /*quality*/> _defaultQualityPerSpecies;
};
-
+}
#endif // BattlePetMgr_h__
diff --git a/src/server/game/Entities/Creature/Trainer.cpp b/src/server/game/Entities/Creature/Trainer.cpp
index 998cb0beff3..f1ef149c634 100644
--- a/src/server/game/Entities/Creature/Trainer.cpp
+++ b/src/server/game/Entities/Creature/Trainer.cpp
@@ -121,7 +121,8 @@ namespace Trainer
if (speciesEntry)
{
- player->GetSession()->GetBattlePetMgr()->AddPet(speciesEntry->ID, BattlePetMgr::SelectPetDisplay(speciesEntry), BattlePetMgr::RollPetBreed(speciesEntry->ID), BattlePetMgr::GetDefaultPetQuality(speciesEntry->ID));
+ player->GetSession()->GetBattlePetMgr()->AddPet(speciesEntry->ID, BattlePets::BattlePetMgr::SelectPetDisplay(speciesEntry),
+ BattlePets::BattlePetMgr::RollPetBreed(speciesEntry->ID), BattlePets::BattlePetMgr::GetDefaultPetQuality(speciesEntry->ID));
// If the spell summons a battle pet, we fake that it has been learned and the battle pet is added
// marking as dependent prevents saving the spell to database (intended)
dependent = true;
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 1c8682a0ff5..4edd20b9d62 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -32,6 +32,7 @@
#include "BattlegroundMgr.h"
#include "BattlegroundPackets.h"
#include "BattlegroundScore.h"
+#include "BattlePetMgr.h"
#include "CellImpl.h"
#include "Channel.h"
#include "ChannelMgr.h"
@@ -18654,7 +18655,7 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder* holder)
// Unlock battle pet system if it's enabled in bnet account
if (GetSession()->GetBattlePetMgr()->IsBattlePetSystemEnabled())
- LearnSpell(SPELL_BATTLE_PET_TRAINING, false);
+ LearnSpell(BattlePets::SPELL_BATTLE_PET_TRAINING, false);
m_achievementMgr->CheckAllAchievementCriteria(this);
m_questObjectiveCriteriaMgr->CheckAllQuestObjectiveCriteria(this);
@@ -22038,7 +22039,7 @@ Creature* Player::GetSummonedBattlePet()
return nullptr;
}
-void Player::SetBattlePetData(BattlePetMgr::BattlePet const* pet)
+void Player::SetBattlePetData(BattlePets::BattlePet const* pet)
{
if (pet)
{
@@ -22050,7 +22051,7 @@ void Player::SetBattlePetData(BattlePetMgr::BattlePet const* pet)
else
{
SetSummonedBattlePetGUID(ObjectGuid::Empty);
- SetCurrentBattlePetBreedQuality(AsUnderlyingType(BattlePetBreedQuality::Poor));
+ SetCurrentBattlePetBreedQuality(AsUnderlyingType(BattlePets::BattlePetBreedQuality::Poor));
SetBattlePetCompanionExperience(0);
SetWildBattlePetLevel(0);
}
@@ -23695,19 +23696,19 @@ void Player::UpdatePotionCooldown(Spell* spell)
void Player::UpdateReviveBattlePetCooldown()
{
- SpellInfo const* reviveBattlePetSpellInfo = sSpellMgr->GetSpellInfo(SPELL_REVIVE_BATTLE_PETS, DIFFICULTY_NONE);
+ SpellInfo const* reviveBattlePetSpellInfo = sSpellMgr->GetSpellInfo(BattlePets::SPELL_REVIVE_BATTLE_PETS, DIFFICULTY_NONE);
- if (reviveBattlePetSpellInfo && HasSpell(SPELL_REVIVE_BATTLE_PETS))
+ if (reviveBattlePetSpellInfo && HasSpell(BattlePets::SPELL_REVIVE_BATTLE_PETS))
{
SpellHistory::Duration remainingCooldown = GetSpellHistory()->GetRemainingCategoryCooldown(reviveBattlePetSpellInfo);
if (remainingCooldown > SpellHistory::Duration::zero())
{
- if (remainingCooldown < REVIVE_BATTLE_PETS_COOLDOWN)
- GetSpellHistory()->ModifyCooldown(reviveBattlePetSpellInfo, REVIVE_BATTLE_PETS_COOLDOWN - remainingCooldown);
+ if (remainingCooldown < BattlePets::REVIVE_BATTLE_PETS_COOLDOWN)
+ GetSpellHistory()->ModifyCooldown(reviveBattlePetSpellInfo, BattlePets::REVIVE_BATTLE_PETS_COOLDOWN - remainingCooldown);
}
else
{
- GetSpellHistory()->StartCooldown(reviveBattlePetSpellInfo, 0, nullptr, false, REVIVE_BATTLE_PETS_COOLDOWN);
+ GetSpellHistory()->StartCooldown(reviveBattlePetSpellInfo, 0, nullptr, false, BattlePets::REVIVE_BATTLE_PETS_COOLDOWN);
}
}
}
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index a5a58add20e..ccc66ea506b 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -19,7 +19,6 @@
#define _PLAYER_H
#include "Unit.h"
-#include "BattlePetMgr.h"
#include "CUFProfile.h"
#include "DatabaseEnvFwd.h"
#include "DBCEnums.h"
@@ -99,6 +98,11 @@ enum LootType : uint8;
enum PlayerRestState : uint8;
enum RestTypes : uint8;
+namespace BattlePets
+{
+ struct BattlePet;
+}
+
namespace WorldPackets
{
namespace Character
@@ -1212,7 +1216,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void RemovePetAura(PetAura const* petSpell);
Creature* GetSummonedBattlePet();
- void SetBattlePetData(BattlePetMgr::BattlePet const* pet = nullptr);
+ void SetBattlePetData(BattlePets::BattlePet const* pet = nullptr);
/// Handles said message in regular chat based on declared language and in config pre-defined Range.
void Say(std::string const& text, Language language, WorldObject const* = nullptr) override;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 2b1dbfdf74e..b09d4e6f5d9 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -5802,7 +5802,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
SetCritterGUID(minion->GetGUID());
if (Player const* thisPlayer = ToPlayer())
{
- if (BattlePetMgr::BattlePet const* pet = thisPlayer->GetSession()->GetBattlePetMgr()->GetPet(thisPlayer->GetSummonedBattlePetGUID()))
+ if (BattlePets::BattlePet const* pet = thisPlayer->GetSession()->GetBattlePetMgr()->GetPet(thisPlayer->GetSummonedBattlePetGUID()))
{
minion->SetBattlePetCompanionGUID(thisPlayer->GetSummonedBattlePetGUID());
minion->SetBattlePetCompanionNameTimestamp(pet->NameTimestamp);
diff --git a/src/server/game/Handlers/BattlePetHandler.cpp b/src/server/game/Handlers/BattlePetHandler.cpp
index bfe2b2ea36a..144612bfebd 100644
--- a/src/server/game/Handlers/BattlePetHandler.cpp
+++ b/src/server/game/Handlers/BattlePetHandler.cpp
@@ -37,8 +37,8 @@ void WorldSession::HandleBattlePetRequestJournalLock(WorldPackets::BattlePet::Ba
void WorldSession::HandleBattlePetSetBattleSlot(WorldPackets::BattlePet::BattlePetSetBattleSlot& battlePetSetBattleSlot)
{
- if (BattlePetMgr::BattlePet* pet = GetBattlePetMgr()->GetPet(battlePetSetBattleSlot.PetGuid))
- if (WorldPackets::BattlePet::BattlePetSlot* slot = GetBattlePetMgr()->GetSlot(BattlePetSlot(battlePetSetBattleSlot.Slot)))
+ if (BattlePets::BattlePet* pet = GetBattlePetMgr()->GetPet(battlePetSetBattleSlot.PetGuid))
+ if (WorldPackets::BattlePet::BattlePetSlot* slot = GetBattlePetMgr()->GetSlot(BattlePets::BattlePetSlot(battlePetSetBattleSlot.Slot)))
slot->Pet = pet->PacketInfo;
}
@@ -69,7 +69,7 @@ void WorldSession::HandleQueryBattlePetName(WorldPackets::BattlePet::QueryBattle
return;
}
- BattlePetMgr::BattlePet const* battlePet = petOwner->ToPlayer()->GetSession()->GetBattlePetMgr()->GetPet(queryBattlePetName.BattlePetID);
+ BattlePets::BattlePet const* battlePet = petOwner->ToPlayer()->GetSession()->GetBattlePetMgr()->GetPet(queryBattlePetName.BattlePetID);
if (!battlePet)
{
SendPacket(response.Write());
@@ -98,15 +98,15 @@ void WorldSession::HandleBattlePetSetFlags(WorldPackets::BattlePet::BattlePetSet
if (!GetBattlePetMgr()->HasJournalLock())
return;
- if (BattlePetMgr::BattlePet* pet = GetBattlePetMgr()->GetPet(battlePetSetFlags.PetGuid))
+ if (BattlePets::BattlePet* pet = GetBattlePetMgr()->GetPet(battlePetSetFlags.PetGuid))
{
- if (battlePetSetFlags.ControlType == FLAGS_CONTROL_TYPE_APPLY)
+ if (battlePetSetFlags.ControlType == BattlePets::FLAGS_CONTROL_TYPE_APPLY)
pet->PacketInfo.Flags |= battlePetSetFlags.Flags;
else // FLAGS_CONTROL_TYPE_REMOVE
pet->PacketInfo.Flags &= ~battlePetSetFlags.Flags;
- if (pet->SaveInfo != BATTLE_PET_NEW)
- pet->SaveInfo = BATTLE_PET_CHANGED;
+ if (pet->SaveInfo != BattlePets::BATTLE_PET_NEW)
+ pet->SaveInfo = BattlePets::BATTLE_PET_CHANGED;
}
}
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp
index 9faace6a55e..c8f33fab7a3 100644
--- a/src/server/game/Handlers/ItemHandler.cpp
+++ b/src/server/game/Handlers/ItemHandler.cpp
@@ -1208,7 +1208,8 @@ void WorldSession::HandleUseCritterItem(WorldPackets::Item::UseCritterItem& useC
continue;
if (BattlePetSpeciesEntry const* speciesEntry = sSpellMgr->GetBattlePetSpecies(uint32(itemEffect->SpellID)))
- GetBattlePetMgr()->AddPet(speciesEntry->ID, BattlePetMgr::SelectPetDisplay(speciesEntry), BattlePetMgr::RollPetBreed(speciesEntry->ID), BattlePetMgr::GetDefaultPetQuality(speciesEntry->ID));
+ GetBattlePetMgr()->AddPet(speciesEntry->ID, BattlePets::BattlePetMgr::SelectPetDisplay(speciesEntry),
+ BattlePets::BattlePetMgr::RollPetBreed(speciesEntry->ID), BattlePets::BattlePetMgr::GetDefaultPetQuality(speciesEntry->ID));
}
_player->DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp
index f735d490903..84d9ef9ff86 100644
--- a/src/server/game/Server/WorldSession.cpp
+++ b/src/server/game/Server/WorldSession.cpp
@@ -139,7 +139,7 @@ WorldSession::WorldSession(uint32 id, std::string&& name, uint32 battlenetAccoun
_timeSyncClockDeltaQueue(6),
_timeSyncClockDelta(0),
_pendingTimeSyncRequests(),
- _battlePetMgr(std::make_unique<BattlePetMgr>(this)),
+ _battlePetMgr(std::make_unique<BattlePets::BattlePetMgr>(this)),
_collectionMgr(std::make_unique<CollectionMgr>(this))
{
memset(_tutorials, 0, sizeof(_tutorials));
diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h
index 24354eccd30..ef54ee1167f 100644
--- a/src/server/game/Server/WorldSession.h
+++ b/src/server/game/Server/WorldSession.h
@@ -40,7 +40,6 @@
#include <unordered_map>
#include <unordered_set>
-class BattlePetMgr;
class BlackMarketEntry;
class CollectionMgr;
class Creature;
@@ -65,6 +64,11 @@ enum class AuctionResult : int8;
enum InventoryResult : uint8;
enum class StableResult : uint8;
+namespace BattlePets
+{
+ class BattlePetMgr;
+}
+
namespace lfg
{
struct LfgJoinResultData;
@@ -1143,7 +1147,7 @@ class TC_GAME_API WorldSession
uint32 AdjustClientMovementTime(uint32 time) const;
// Battle Pets
- BattlePetMgr* GetBattlePetMgr() const { return _battlePetMgr.get(); }
+ BattlePets::BattlePetMgr* GetBattlePetMgr() const { return _battlePetMgr.get(); }
CollectionMgr* GetCollectionMgr() const { return _collectionMgr.get(); }
@@ -1929,7 +1933,7 @@ class TC_GAME_API WorldSession
uint32 _timeSyncNextCounter;
uint32 _timeSyncTimer;
- std::unique_ptr<BattlePetMgr> _battlePetMgr;
+ std::unique_ptr<BattlePets::BattlePetMgr> _battlePetMgr;
std::unique_ptr<CollectionMgr> _collectionMgr;
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 7d337387441..cf8fe0fa959 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2053,7 +2053,8 @@ void Spell::EffectLearnSpell()
if (BattlePetSpeciesEntry const* speciesEntry = sSpellMgr->GetBattlePetSpecies(uint32(itemEffect->SpellID)))
{
- player->GetSession()->GetBattlePetMgr()->AddPet(speciesEntry->ID, BattlePetMgr::SelectPetDisplay(speciesEntry), BattlePetMgr::RollPetBreed(speciesEntry->ID), BattlePetMgr::GetDefaultPetQuality(speciesEntry->ID));
+ player->GetSession()->GetBattlePetMgr()->AddPet(speciesEntry->ID, BattlePets::BattlePetMgr::SelectPetDisplay(speciesEntry),
+ BattlePets::BattlePetMgr::RollPetBreed(speciesEntry->ID), BattlePets::BattlePetMgr::GetDefaultPetQuality(speciesEntry->ID));
// If the spell summons a battle pet, we fake that it has been learned and the battle pet is added
// marking as dependent prevents saving the spell to database (intended)
dependent = true;
@@ -5291,7 +5292,7 @@ void Spell::EffectHealBattlePetPct()
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
- if (BattlePetMgr* battlePetMgr = unitTarget->ToPlayer()->GetSession()->GetBattlePetMgr())
+ if (BattlePets::BattlePetMgr* battlePetMgr = unitTarget->ToPlayer()->GetSession()->GetBattlePetMgr())
battlePetMgr->HealBattlePetsPct(damage);
}
@@ -5305,7 +5306,7 @@ void Spell::EffectEnableBattlePets()
Player* player = unitTarget->ToPlayer();
player->AddPlayerFlag(PLAYER_FLAGS_PET_BATTLES_UNLOCKED);
- player->GetSession()->GetBattlePetMgr()->UnlockSlot(BattlePetSlot::Slot0);
+ player->GetSession()->GetBattlePetMgr()->UnlockSlot(BattlePets::BattlePetSlot::Slot0);
}
void Spell::EffectLaunchQuestChoice()
@@ -5338,27 +5339,27 @@ void Spell::EffectUncageBattlePet()
return;
Player* player = m_caster->ToPlayer();
- BattlePetMgr* battlePetMgr = player->GetSession()->GetBattlePetMgr();
+ BattlePets::BattlePetMgr* battlePetMgr = player->GetSession()->GetBattlePetMgr();
if (!battlePetMgr)
return;
if (battlePetMgr->GetMaxPetLevel() < level)
{
- battlePetMgr->SendError(BattlePetError::TooHighLevelToUncage, speciesEntry->CreatureID);
+ battlePetMgr->SendError(BattlePets::BattlePetError::TooHighLevelToUncage, speciesEntry->CreatureID);
SendCastResult(SPELL_FAILED_CANT_ADD_BATTLE_PET);
return;
}
if (battlePetMgr->HasMaxPetCount(speciesEntry, player->GetGUID()))
{
- battlePetMgr->SendError(BattlePetError::CantHaveMorePetsOfType, speciesEntry->CreatureID);
+ battlePetMgr->SendError(BattlePets::BattlePetError::CantHaveMorePetsOfType, speciesEntry->CreatureID);
SendCastResult(SPELL_FAILED_CANT_ADD_BATTLE_PET);
return;
}
- battlePetMgr->AddPet(speciesId, displayId, breed, BattlePetBreedQuality(quality), level);
+ battlePetMgr->AddPet(speciesId, displayId, breed, BattlePets::BattlePetBreedQuality(quality), level);
- player->SendPlaySpellVisual(player, SPELL_VISUAL_UNCAGE_PET, 0, 0, 0.f, false);
+ player->SendPlaySpellVisual(player, BattlePets::SPELL_VISUAL_UNCAGE_PET, 0, 0, 0.f, false);
player->DestroyItem(m_CastItem->GetBagSlot(), m_CastItem->GetSlot(), true);
m_CastItem = nullptr;
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 87b8ad5a3ec..be04aef3b90 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -2402,7 +2402,7 @@ void World::SetInitialWorldSettings()
sObjectMgr->LoadRealmNames();
TC_LOG_INFO("server.loading", "Loading battle pets info...");
- BattlePetMgr::Initialize();
+ BattlePets::BattlePetMgr::Initialize();
TC_LOG_INFO("server.loading", "Loading scenarios");
sScenarioMgr->LoadDB2Data();