aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp125
-rw-r--r--src/server/game/Globals/ObjectMgr.h101
2 files changed, 113 insertions, 113 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 0beb43b591b..a8c83c13578 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -67,7 +67,7 @@ std::string GetScriptsTableNameByType(ScriptsType type)
ScriptMapMap* GetScriptsMapByType(ScriptsType type)
{
- ScriptMapMap* res = NULL;
+ ScriptMapMap* res = nullptr;
switch (type)
{
case SCRIPTS_SPELL: res = &sSpellScripts; break;
@@ -197,7 +197,7 @@ LanguageDesc const* GetLanguageDescByID(uint32 lang)
return &lang_description[i];
}
- return NULL;
+ return nullptr;
}
bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clickee) const
@@ -206,7 +206,7 @@ bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clicke
if (!playerClicker)
return true;
- Unit const* summoner = NULL;
+ Unit const* summoner = nullptr;
// Check summoners for party
if (clickee->IsSummon())
summoner = clickee->ToTempSummon()->GetSummoner();
@@ -247,8 +247,9 @@ ObjectMgr::ObjectMgr():
DBCLocaleIndex(LOCALE_enUS)
{
for (uint8 i = 0; i < MAX_CLASSES; ++i)
+
for (uint8 j = 0; j < MAX_RACES; ++j)
- _playerInfo[j][i] = NULL;
+ _playerInfo[j][i] = nullptr;
}
ObjectMgr* ObjectMgr::instance()
@@ -791,7 +792,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has non-existing faction template (%u).", cInfo->Entry, cInfo->faction);
// used later for scale
- CreatureDisplayInfoEntry const* displayScaleEntry = NULL;
+ CreatureDisplayInfoEntry const* displayScaleEntry = nullptr;
if (cInfo->Modelid1)
{
@@ -1172,41 +1173,41 @@ void ObjectMgr::LoadGameObjectAddons()
TC_LOG_INFO("server.loading", ">> Loaded %u gameobject addons in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
-GameObjectAddon const* ObjectMgr::GetGameObjectAddon(ObjectGuid::LowType lowguid)
+GameObjectAddon const* ObjectMgr::GetGameObjectAddon(ObjectGuid::LowType lowguid) const
{
GameObjectAddonContainer::const_iterator itr = _gameObjectAddonStore.find(lowguid);
if (itr != _gameObjectAddonStore.end())
return &(itr->second);
- return NULL;
+ return nullptr;
}
-CreatureAddon const* ObjectMgr::GetCreatureAddon(ObjectGuid::LowType lowguid)
+CreatureAddon const* ObjectMgr::GetCreatureAddon(ObjectGuid::LowType lowguid) const
{
CreatureAddonContainer::const_iterator itr = _creatureAddonStore.find(lowguid);
if (itr != _creatureAddonStore.end())
return &(itr->second);
- return NULL;
+ return nullptr;
}
-CreatureAddon const* ObjectMgr::GetCreatureTemplateAddon(uint32 entry)
+CreatureAddon const* ObjectMgr::GetCreatureTemplateAddon(uint32 entry) const
{
CreatureTemplateAddonContainer::const_iterator itr = _creatureTemplateAddonStore.find(entry);
if (itr != _creatureTemplateAddonStore.end())
return &(itr->second);
- return NULL;
+ return nullptr;
}
-EquipmentInfo const* ObjectMgr::GetEquipmentInfo(uint32 entry, int8& id)
+EquipmentInfo const* ObjectMgr::GetEquipmentInfo(uint32 entry, int8& id) const
{
EquipmentInfoContainer::const_iterator itr = _equipmentInfoStore.find(entry);
if (itr == _equipmentInfoStore.end())
- return NULL;
+ return nullptr;
if (itr->second.empty())
- return NULL;
+ return nullptr;
if (id == -1) // select a random element
{
@@ -1222,7 +1223,7 @@ EquipmentInfo const* ObjectMgr::GetEquipmentInfo(uint32 entry, int8& id)
return &itr2->second;
}
- return NULL;
+ return nullptr;
}
void ObjectMgr::LoadEquipmentTemplates()
@@ -1302,16 +1303,16 @@ void ObjectMgr::LoadEquipmentTemplates()
TC_LOG_INFO("server.loading", ">> Loaded %u equipment templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
-CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId)
+CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId) const
{
CreatureModelContainer::const_iterator itr = _creatureModelStore.find(modelId);
if (itr != _creatureModelStore.end())
return &(itr->second);
- return NULL;
+ return nullptr;
}
-uint32 ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data /*= NULL*/)
+uint32 ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data /*= nullptr*/)
{
// Load creature model (display id)
if (data && data->displayid)
@@ -1324,7 +1325,7 @@ uint32 ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData co
return cinfo->GetFirstInvisibleModel();
}
-void ObjectMgr::ChooseCreatureFlags(CreatureTemplate const* cinfo, uint64& npcflag, uint32& unit_flags, uint32& dynamicflags, CreatureData const* data /*= NULL*/)
+void ObjectMgr::ChooseCreatureFlags(const CreatureTemplate* cinfo, uint64& npcflag, uint32& unit_flags, uint32& dynamicflags, const CreatureData* data /*= nullptr*/)
{
npcflag = cinfo->npcflag;
unit_flags = cinfo->unit_flags;
@@ -1343,11 +1344,11 @@ void ObjectMgr::ChooseCreatureFlags(CreatureTemplate const* cinfo, uint64& npcfl
}
}
-CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* displayID)
+CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* displayID) const
{
CreatureModelInfo const* modelInfo = GetCreatureModelInfo(*displayID);
if (!modelInfo)
- return NULL;
+ return nullptr;
// If a model for another gender exists, 50% chance to use it
if (modelInfo->displayId_other_gender != 0 && urand(0, 1) == 0)
@@ -2890,12 +2891,13 @@ void ObjectMgr::LoadItemScriptNames()
TC_LOG_INFO("server.loading", ">> Loaded %u item script names in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
-ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry)
+
+ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry) const
{
ItemTemplateContainer::const_iterator itr = _itemTemplateStore.find(entry);
if (itr != _itemTemplateStore.end())
return &(itr->second);
- return NULL;
+ return nullptr;
}
void ObjectMgr::LoadVehicleTemplateAccessories()
@@ -3041,8 +3043,7 @@ void ObjectMgr::LoadPetLevelInfo()
}
PetLevelInfo*& pInfoMapEntry = _petInfoStore[creature_id];
-
- if (pInfoMapEntry == NULL)
+ if (!pInfoMapEntry)
pInfoMapEntry = new PetLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)];
// data for level 1 stored in [0] array element, ...
@@ -3094,7 +3095,7 @@ PetLevelInfo const* ObjectMgr::GetPetLevelInfo(uint32 creature_id, uint8 level)
PetLevelInfoContainer::const_iterator itr = _petInfoStore.find(creature_id);
if (itr == _petInfoStore.end())
- return NULL;
+ return nullptr;
return &itr->second[level-1]; // data for level 1 stored in [0] array element, ...
}
@@ -3965,7 +3966,7 @@ void ObjectMgr::LoadQuests()
for (QuestMap::iterator iter = _questTemplates.begin(); iter != _questTemplates.end(); ++iter)
{
// skip post-loading checks for disabled quests
- if (DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, iter->first, NULL))
+ if (DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, iter->first, nullptr))
continue;
Quest* qinfo = iter->second;
@@ -5282,7 +5283,7 @@ PageText const* ObjectMgr::GetPageText(uint32 pageEntry)
if (itr != _pageTextStore.end())
return &(itr->second);
- return NULL;
+ return nullptr;
}
void ObjectMgr::LoadPageTextLocales()
@@ -5356,13 +5357,13 @@ void ObjectMgr::LoadInstanceTemplate()
TC_LOG_INFO("server.loading", ">> Loaded %u instance templates in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
-InstanceTemplate const* ObjectMgr::GetInstanceTemplate(uint32 mapID)
+InstanceTemplate const* ObjectMgr::GetInstanceTemplate(uint32 mapID) const
{
InstanceTemplateContainer::const_iterator itr = _instanceTemplateStore.find(uint16(mapID));
if (itr != _instanceTemplateStore.end())
return &(itr->second);
- return NULL;
+ return nullptr;
}
void ObjectMgr::LoadInstanceEncounters()
@@ -5469,7 +5470,7 @@ NpcText const* ObjectMgr::GetNpcText(uint32 Text_ID) const
NpcTextContainer::const_iterator itr = _npcTextStore.find(Text_ID);
if (itr != _npcTextStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
void ObjectMgr::LoadNPCText()
@@ -5538,7 +5539,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
{
uint32 oldMSTime = getMSTime();
- time_t curTime = time(NULL);
+ time_t curTime = time(nullptr);
tm lt;
localtime_r(&curTime, &lt);
uint64 basetime(curTime);
@@ -5593,7 +5594,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
m->checked = fields[7].GetUInt8();
m->mailTemplateId = fields[8].GetInt16();
- Player* player = NULL;
+ Player* player = nullptr;
if (serverUp)
player = ObjectAccessor::FindConnectedPlayer(ObjectGuid::Create<HighGuid::Player>(m->receiver));
@@ -6021,7 +6022,7 @@ void ObjectMgr::LoadGraveyardZones()
TC_LOG_INFO("server.loading", ">> Loaded %u graveyard-zone links in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
-WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveYard(uint32 team)
+WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveYard(uint32 team) const
{
enum DefaultGraveyard
{
@@ -6033,10 +6034,10 @@ WorldSafeLocsEntry const* ObjectMgr::GetDefaultGraveYard(uint32 team)
return sWorldSafeLocsStore.LookupEntry(HORDE_GRAVEYARD);
else if (team == ALLIANCE)
return sWorldSafeLocsStore.LookupEntry(ALLIANCE_GRAVEYARD);
- else return NULL;
+ else return nullptr;
}
-WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team)
+WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team) const
{
// search for zone associated closest graveyard
uint32 zoneId = sMapMgr->GetZoneId(MapId, x, y, z);
@@ -6071,15 +6072,15 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
// at corpse map
bool foundNear = false;
float distNear = 10000;
- WorldSafeLocsEntry const* entryNear = NULL;
+ WorldSafeLocsEntry const* entryNear = nullptr;
// at entrance map for corpse map
bool foundEntr = false;
float distEntr = 10000;
- WorldSafeLocsEntry const* entryEntr = NULL;
+ WorldSafeLocsEntry const* entryEntr = nullptr;
// some where other
- WorldSafeLocsEntry const* entryFar = NULL;
+ WorldSafeLocsEntry const* entryFar = nullptr;
MapEntry const* mapEntry = sMapStore.LookupEntry(MapId);
@@ -6161,7 +6162,7 @@ WorldSafeLocsEntry const* ObjectMgr::GetClosestGraveYard(float x, float y, float
return entryFar;
}
-GraveYardData const* ObjectMgr::FindGraveYardData(uint32 id, uint32 zoneId)
+GraveYardData const* ObjectMgr::FindGraveYardData(uint32 id, uint32 zoneId) const
{
GraveYardMapBounds range = GraveYardStore.equal_range(zoneId);
for (; range.first != range.second; ++range.first)
@@ -6170,7 +6171,7 @@ GraveYardData const* ObjectMgr::FindGraveYardData(uint32 id, uint32 zoneId)
if (data.safeLocId == id)
return &data;
}
- return NULL;
+ return nullptr;
}
bool ObjectMgr::AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist /*= true*/)
@@ -6420,14 +6421,14 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
uint32 parentId = 0;
const MapEntry* mapEntry = sMapStore.LookupEntry(Map);
if (!mapEntry || mapEntry->CorpseMapID < 0)
- return NULL;
+ return nullptr;
if (mapEntry->IsDungeon())
{
const InstanceTemplate* iTemplate = sObjectMgr->GetInstanceTemplate(Map);
if (!iTemplate)
- return NULL;
+ return nullptr;
parentId = iTemplate->Parent;
useParentDbValue = true;
@@ -6441,7 +6442,7 @@ AreaTriggerStruct const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
if (atEntry && atEntry->MapID == Map)
return &itr->second;
}
- return NULL;
+ return nullptr;
}
/**
@@ -6458,7 +6459,7 @@ AreaTriggerStruct const* ObjectMgr::GetMapEntranceTrigger(uint32 Map) const
return &itr->second;
}
}
- return NULL;
+ return nullptr;
}
void ObjectMgr::SetHighestGuids()
@@ -7956,7 +7957,7 @@ bool ObjectMgr::CheckDeclinedNames(const std::wstring& w_ownname, DeclinedName c
return (x || y);
}
-uint32 ObjectMgr::GetAreaTriggerScriptId(uint32 trigger_id)
+uint32 ObjectMgr::GetAreaTriggerScriptId(uint32 trigger_id) const
{
AreaTriggerScriptContainer::const_iterator i = _areaTriggerScriptStore.find(trigger_id);
if (i!= _areaTriggerScriptStore.end())
@@ -7970,7 +7971,7 @@ SpellScriptsBounds ObjectMgr::GetSpellScriptsBounds(uint32 spellId)
}
// this allows calculating base reputations to offline players, just by race and class
-int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 race, uint8 playerClass)
+int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 race, uint8 playerClass) const
{
if (!factionEntry)
return 0;
@@ -8073,18 +8074,18 @@ GameTele const* ObjectMgr::GetGameTele(const std::string& name) const
// explicit name case
std::wstring wname;
if (!Utf8toWStr(name, wname))
- return NULL;
+ return nullptr;
// converting string that we try to find to lower case
wstrToLower(wname);
// Alternative first GameTele what contains wnameLow as substring in case no GameTele location found
- const GameTele* alt = NULL;
+ GameTele const* alt = nullptr;
for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
{
if (itr->second.wnameLow == wname)
return &itr->second;
- else if (alt == NULL && itr->second.wnameLow.find(wname) != std::wstring::npos)
+ else if (!alt && itr->second.wnameLow.find(wname) != std::wstring::npos)
alt = &itr->second;
}
@@ -8096,7 +8097,7 @@ GameTele const* ObjectMgr::GetGameTeleExactName(const std::string& name) const
// explicit name case
std::wstring wname;
if (!Utf8toWStr(name, wname))
- return NULL;
+ return nullptr;
// converting string that we try to find to lower case
wstrToLower(wname);
@@ -8107,7 +8108,7 @@ GameTele const* ObjectMgr::GetGameTeleExactName(const std::string& name) const
return &itr->second;
}
- return NULL;
+ return nullptr;
}
bool ObjectMgr::AddGameTele(GameTele& tele)
@@ -8370,7 +8371,7 @@ int ObjectMgr::LoadReferenceVendor(int32 vendor, int32 item, uint8 referenceType
uint32 ExtendedCost = fields[3].GetUInt32();
uint8 type = fields[4].GetUInt8();
- if (!IsVendorItemValid(vendor, item_id, maxcount, incrtime, ExtendedCost, type, NULL, skip_vendors))
+ if (!IsVendorItemValid(vendor, item_id, maxcount, incrtime, ExtendedCost, type, nullptr, skip_vendors))
continue;
VendorItemData& vList = _cacheVendorItemStore[vendor];
@@ -8421,7 +8422,7 @@ void ObjectMgr::LoadVendors()
uint32 ExtendedCost = fields[4].GetUInt32();
uint8 type = fields[5].GetUInt8();
- if (!IsVendorItemValid(entry, item_id, maxcount, incrtime, ExtendedCost, type, NULL, &skip_vendors))
+ if (!IsVendorItemValid(entry, item_id, maxcount, incrtime, ExtendedCost, type, nullptr, &skip_vendors))
continue;
VendorItemData& vList = _cacheVendorItemStore[entry];
@@ -9210,22 +9211,22 @@ void ObjectMgr::LoadAreaPhases()
TC_LOG_INFO("server.loading", ">> Loaded %u phase areas in %u ms.", count, GetMSTimeDiffToNow(oldMSTime));
}
-GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry)
+GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry) const
{
GameObjectTemplateContainer::const_iterator itr = _gameObjectTemplateStore.find(entry);
if (itr != _gameObjectTemplateStore.end())
return &(itr->second);
- return NULL;
+ return nullptr;
}
-CreatureTemplate const* ObjectMgr::GetCreatureTemplate(uint32 entry)
+CreatureTemplate const* ObjectMgr::GetCreatureTemplate(uint32 entry) const
{
CreatureTemplateContainer::const_iterator itr = _creatureTemplateStore.find(entry);
if (itr != _creatureTemplateStore.end())
return &(itr->second);
- return NULL;
+ return nullptr;
}
VehicleAccessoryList const* ObjectMgr::GetVehicleAccessoryList(Vehicle* veh) const
@@ -9242,18 +9243,18 @@ VehicleAccessoryList const* ObjectMgr::GetVehicleAccessoryList(Vehicle* veh) con
VehicleAccessoryTemplateContainer::const_iterator itr = _vehicleTemplateAccessoryStore.find(veh->GetCreatureEntry());
if (itr != _vehicleTemplateAccessoryStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
PlayerInfo const* ObjectMgr::GetPlayerInfo(uint32 race, uint32 class_) const
{
if (race >= MAX_RACES)
- return NULL;
+ return nullptr;
if (class_ >= MAX_CLASSES)
- return NULL;
+ return nullptr;
PlayerInfo const* info = _playerInfo[race][class_];
if (!info)
- return NULL;
+ return nullptr;
return info;
}
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index 1d76813cbab..e0018aa9998 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -740,27 +740,26 @@ class TC_GAME_API ObjectMgr
Player* GetPlayerByLowGUID(ObjectGuid::LowType lowguid) const;
- GameObjectTemplate const* GetGameObjectTemplate(uint32 entry);
+ GameObjectTemplate const* GetGameObjectTemplate(uint32 entry) const;
GameObjectTemplateContainer const* GetGameObjectTemplates() const { return &_gameObjectTemplateStore; }
int LoadReferenceVendor(int32 vendor, int32 item, uint8 type, std::set<uint32> *skip_vendors);
void LoadGameObjectTemplate();
- void AddGameobjectInfo(GameObjectTemplate* goinfo);
- CreatureTemplate const* GetCreatureTemplate(uint32 entry);
+ CreatureTemplate const* GetCreatureTemplate(uint32 entry) const;
CreatureTemplateContainer const* GetCreatureTemplates() const { return &_creatureTemplateStore; }
- CreatureModelInfo const* GetCreatureModelInfo(uint32 modelId);
- CreatureModelInfo const* GetCreatureModelRandomGender(uint32* displayID);
- static uint32 ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data = NULL);
- static void ChooseCreatureFlags(CreatureTemplate const* cinfo, uint64& npcflag, uint32& unit_flags, uint32& dynamicflags, CreatureData const* data = NULL);
- EquipmentInfo const* GetEquipmentInfo(uint32 entry, int8& id);
- CreatureAddon const* GetCreatureAddon(ObjectGuid::LowType lowguid);
- GameObjectAddon const* GetGameObjectAddon(ObjectGuid::LowType lowguid);
- CreatureAddon const* GetCreatureTemplateAddon(uint32 entry);
- ItemTemplate const* GetItemTemplate(uint32 entry);
+ CreatureModelInfo const* GetCreatureModelInfo(uint32 modelId) const;
+ CreatureModelInfo const* GetCreatureModelRandomGender(uint32* displayID) const;
+ static uint32 ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data = nullptr);
+ static void ChooseCreatureFlags(CreatureTemplate const* cinfo, uint64& npcflag, uint32& unit_flags, uint32& dynamicflags, CreatureData const* data = nullptr);
+ EquipmentInfo const* GetEquipmentInfo(uint32 entry, int8& id) const;
+ CreatureAddon const* GetCreatureAddon(ObjectGuid::LowType lowguid) const;
+ GameObjectAddon const* GetGameObjectAddon(ObjectGuid::LowType lowguid) const;
+ CreatureAddon const* GetCreatureTemplateAddon(uint32 entry) const;
+ ItemTemplate const* GetItemTemplate(uint32 entry) const;
ItemTemplateContainer const* GetItemTemplateStore() const { return &_itemTemplateStore; }
- InstanceTemplate const* GetInstanceTemplate(uint32 mapId);
+ InstanceTemplate const* GetInstanceTemplate(uint32 mapId) const;
PetLevelInfo const* GetPetLevelInfo(uint32 creature_id, uint8 level) const;
@@ -777,7 +776,7 @@ class TC_GAME_API ObjectMgr
GameObjectQuestItemMap::const_iterator itr = _gameObjectQuestItemStore.find(id);
if (itr != _gameObjectQuestItemStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
GameObjectQuestItemMap const* GetGameObjectQuestItemMap() const { return &_gameObjectQuestItemStore; }
@@ -786,7 +785,7 @@ class TC_GAME_API ObjectMgr
CreatureQuestItemMap::const_iterator itr = _creatureQuestItemStore.find(id);
if (itr != _creatureQuestItemStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
CreatureQuestItemMap const* GetCreatureQuestItemMap() const { return &_creatureQuestItemStore; }
@@ -817,7 +816,7 @@ class TC_GAME_API ObjectMgr
Quest const* GetQuestTemplate(uint32 quest_id) const
{
QuestMap::const_iterator itr = _questTemplates.find(quest_id);
- return itr != _questTemplates.end() ? itr->second : NULL;
+ return itr != _questTemplates.end() ? itr->second : nullptr;
}
QuestMap const& GetQuestTemplates() const { return _questTemplates; }
@@ -843,19 +842,19 @@ class TC_GAME_API ObjectMgr
NpcText const* GetNpcText(uint32 textID) const;
QuestGreeting const* GetQuestGreeting(ObjectGuid guid) const;
- WorldSafeLocsEntry const* GetDefaultGraveYard(uint32 team);
- WorldSafeLocsEntry const* GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team);
+ WorldSafeLocsEntry const* GetDefaultGraveYard(uint32 team) const;
+ WorldSafeLocsEntry const* GetClosestGraveYard(float x, float y, float z, uint32 MapId, uint32 team) const;
bool AddGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist = true);
void RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool persist = false);
void LoadGraveyardZones();
- GraveYardData const* FindGraveYardData(uint32 id, uint32 zone);
+ GraveYardData const* FindGraveYardData(uint32 id, uint32 zone) const;
AreaTriggerStruct const* GetAreaTrigger(uint32 trigger) const
{
AreaTriggerContainer::const_iterator itr = _areaTriggerStore.find(trigger);
if (itr != _areaTriggerStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
AccessRequirement const* GetAccessRequirement(uint32 mapid, Difficulty difficulty) const
@@ -863,13 +862,13 @@ class TC_GAME_API ObjectMgr
AccessRequirementContainer::const_iterator itr = _accessRequirementStore.find(MAKE_PAIR64(mapid, difficulty));
if (itr != _accessRequirementStore.end())
return itr->second;
- return NULL;
+ return nullptr;
}
AreaTriggerStruct const* GetGoBackTrigger(uint32 Map) const;
AreaTriggerStruct const* GetMapEntranceTrigger(uint32 Map) const;
- uint32 GetAreaTriggerScriptId(uint32 trigger_id);
+ uint32 GetAreaTriggerScriptId(uint32 trigger_id) const;
SpellScriptsBounds GetSpellScriptsBounds(uint32 spellId);
RepRewardRate const* GetRepRewardRate(uint32 factionId) const
@@ -878,7 +877,7 @@ class TC_GAME_API ObjectMgr
if (itr != _repRewardRateStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
ReputationOnKillEntry const* GetReputationOnKilEntry(uint32 id) const
@@ -886,10 +885,10 @@ class TC_GAME_API ObjectMgr
RepOnKillContainer::const_iterator itr = _repOnKillStore.find(id);
if (itr != _repOnKillStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
- int32 GetBaseReputationOf(FactionEntry const* factionEntry, uint8 race, uint8 playerClass);
+ int32 GetBaseReputationOf(FactionEntry const* factionEntry, uint8 race, uint8 playerClass) const;
RepSpilloverTemplate const* GetRepSpilloverTemplate(uint32 factionId) const
{
@@ -897,7 +896,7 @@ class TC_GAME_API ObjectMgr
if (itr != _repSpilloverTemplateStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
PointOfInterest const* GetPointOfInterest(uint32 id) const
@@ -905,7 +904,7 @@ class TC_GAME_API ObjectMgr
PointOfInterestContainer::const_iterator itr = _pointsOfInterestStore.find(id);
if (itr != _pointsOfInterestStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
QuestPOIVector const* GetQuestPOIVector(int32 QuestID)
@@ -913,17 +912,17 @@ class TC_GAME_API ObjectMgr
QuestPOIContainer::const_iterator itr = _questPOIStore.find(QuestID);
if (itr != _questPOIStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
VehicleAccessoryList const* GetVehicleAccessoryList(Vehicle* veh) const;
- DungeonEncounterList const* GetDungeonEncounterList(uint32 mapId, Difficulty difficulty)
+ DungeonEncounterList const* GetDungeonEncounterList(uint32 mapId, Difficulty difficulty) const
{
DungeonEncounterContainer::const_iterator itr = _dungeonEncounterStore.find(MAKE_PAIR64(mapId, difficulty));
if (itr != _dungeonEncounterStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
void LoadQuests();
@@ -948,17 +947,17 @@ class TC_GAME_API ObjectMgr
return &_goQuestRelations;
}
- QuestRelationBounds GetGOQuestRelationBounds(uint32 go_entry)
+ QuestRelationBounds GetGOQuestRelationBounds(uint32 go_entry) const
{
return _goQuestRelations.equal_range(go_entry);
}
- QuestRelationBounds GetGOQuestInvolvedRelationBounds(uint32 go_entry)
+ QuestRelationBounds GetGOQuestInvolvedRelationBounds(uint32 go_entry) const
{
return _goQuestInvolvedRelations.equal_range(go_entry);
}
- QuestRelationReverseBounds GetGOQuestInvolvedRelationReverseBounds(uint32 questId)
+ QuestRelationReverseBounds GetGOQuestInvolvedRelationReverseBounds(uint32 questId) const
{
return _goQuestInvolvedRelationsReverse.equal_range(questId);
}
@@ -968,17 +967,17 @@ class TC_GAME_API ObjectMgr
return &_creatureQuestRelations;
}
- QuestRelationBounds GetCreatureQuestRelationBounds(uint32 creature_entry)
+ QuestRelationBounds GetCreatureQuestRelationBounds(uint32 creature_entry) const
{
return _creatureQuestRelations.equal_range(creature_entry);
}
- QuestRelationBounds GetCreatureQuestInvolvedRelationBounds(uint32 creature_entry)
+ QuestRelationBounds GetCreatureQuestInvolvedRelationBounds(uint32 creature_entry) const
{
return _creatureQuestInvolvedRelations.equal_range(creature_entry);
}
- QuestRelationReverseBounds GetCreatureQuestInvolvedRelationReverseBounds(uint32 questId)
+ QuestRelationReverseBounds GetCreatureQuestInvolvedRelationReverseBounds(uint32 questId) const
{
return _creatureQuestInvolvedRelationsReverse.equal_range(questId);
}
@@ -1114,13 +1113,13 @@ class TC_GAME_API ObjectMgr
{
MailLevelRewardContainer::const_iterator map_itr = _mailLevelRewardStore.find(level);
if (map_itr == _mailLevelRewardStore.end())
- return NULL;
+ return nullptr;
for (MailLevelRewardList::const_iterator set_itr = map_itr->second.begin(); set_itr != map_itr->second.end(); ++set_itr)
if (set_itr->raceMask & raceMask)
return &*set_itr;
- return NULL;
+ return nullptr;
}
CellObjectGuids const& GetCellObjectGuids(uint16 mapid, uint8 spawnMode, uint32 cell_id)
@@ -1148,13 +1147,13 @@ class TC_GAME_API ObjectMgr
if (itr != _tempSummonDataStore.end())
return &itr->second;
- return NULL;
+ return nullptr;
}
CreatureData const* GetCreatureData(ObjectGuid::LowType guid) const
{
CreatureDataContainer::const_iterator itr = _creatureDataStore.find(guid);
- if (itr == _creatureDataStore.end()) return NULL;
+ if (itr == _creatureDataStore.end()) return nullptr;
return &itr->second;
}
CreatureData& NewOrExistCreatureData(ObjectGuid::LowType guid) { return _creatureDataStore[guid]; }
@@ -1168,50 +1167,50 @@ class TC_GAME_API ObjectMgr
CreatureLocale const* GetCreatureLocale(uint32 entry) const
{
CreatureLocaleContainer::const_iterator itr = _creatureLocaleStore.find(entry);
- if (itr == _creatureLocaleStore.end()) return NULL;
+ if (itr == _creatureLocaleStore.end()) return nullptr;
return &itr->second;
}
GameObjectLocale const* GetGameObjectLocale(uint32 entry) const
{
GameObjectLocaleContainer::const_iterator itr = _gameObjectLocaleStore.find(entry);
- if (itr == _gameObjectLocaleStore.end()) return NULL;
+ if (itr == _gameObjectLocaleStore.end()) return nullptr;
return &itr->second;
}
QuestTemplateLocale const* GetQuestLocale(uint32 entry) const
{
QuestTemplateLocaleContainer::const_iterator itr = _questTemplateLocaleStore.find(entry);
- if (itr == _questTemplateLocaleStore.end()) return NULL;
+ if (itr == _questTemplateLocaleStore.end()) return nullptr;
return &itr->second;
}
QuestObjectivesLocale const* GetQuestObjectivesLocale(uint32 entry) const
{
QuestObjectivesLocaleContainer::const_iterator itr = _questObjectivesLocaleStore.find(entry);
- if (itr == _questObjectivesLocaleStore.end()) return NULL;
+ if (itr == _questObjectivesLocaleStore.end()) return nullptr;
return &itr->second;
}
PageTextLocale const* GetPageTextLocale(uint32 entry) const
{
PageTextLocaleContainer::const_iterator itr = _pageTextLocaleStore.find(entry);
- if (itr == _pageTextLocaleStore.end()) return NULL;
+ if (itr == _pageTextLocaleStore.end()) return nullptr;
return &itr->second;
}
GossipMenuItemsLocale const* GetGossipMenuItemsLocale(uint32 entry) const
{
GossipMenuItemsLocaleContainer::const_iterator itr = _gossipMenuItemsLocaleStore.find(entry);
- if (itr == _gossipMenuItemsLocaleStore.end()) return NULL;
+ if (itr == _gossipMenuItemsLocaleStore.end()) return nullptr;
return &itr->second;
}
PointOfInterestLocale const* GetPointOfInterestLocale(uint32 id) const
{
PointOfInterestLocaleContainer::const_iterator itr = _pointOfInterestLocaleStore.find(id);
- if (itr == _pointOfInterestLocaleStore.end()) return NULL;
+ if (itr == _pointOfInterestLocaleStore.end()) return nullptr;
return &itr->second;
}
GameObjectData const* GetGOData(ObjectGuid::LowType guid) const
{
GameObjectDataContainer::const_iterator itr = _gameObjectDataStore.find(guid);
- if (itr == _gameObjectDataStore.end()) return NULL;
+ if (itr == _gameObjectDataStore.end()) return nullptr;
return &itr->second;
}
GameObjectData& NewGOData(ObjectGuid::LowType guid) { return _gameObjectDataStore[guid]; }
@@ -1251,7 +1250,7 @@ class TC_GAME_API ObjectMgr
GameTele const* GetGameTele(uint32 id) const
{
GameTeleContainer::const_iterator itr = _gameTeleStore.find(id);
- if (itr == _gameTeleStore.end()) return NULL;
+ if (itr == _gameTeleStore.end()) return nullptr;
return &itr->second;
}
GameTele const* GetGameTele(std::string const& name) const;
@@ -1264,7 +1263,7 @@ class TC_GAME_API ObjectMgr
{
CacheTrainerSpellContainer::const_iterator iter = _cacheTrainerSpellStore.find(entry);
if (iter == _cacheTrainerSpellStore.end())
- return NULL;
+ return nullptr;
return &iter->second;
}
@@ -1273,7 +1272,7 @@ class TC_GAME_API ObjectMgr
{
CacheVendorItemContainer::const_iterator iter = _cacheVendorItemStore.find(entry);
if (iter == _cacheVendorItemStore.end())
- return NULL;
+ return nullptr;
return &iter->second;
}