refactor(Core): NULL -> nullptr (#3275)
* NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr * NULL to nullptr Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com> Co-authored-by: Stefano Borzì <stefanoborzi32@gmail.com>
This commit is contained in:
@@ -44,7 +44,7 @@ ObjectAccessor* ObjectAccessor::instance()
|
||||
Player* ObjectAccessor::GetObjectInWorld(uint64 guid, Player* /*typeSpecifier*/)
|
||||
{
|
||||
Player* player = HashMapHolder<Player>::Find(guid);
|
||||
return player && player->IsInWorld() ? player : NULL;
|
||||
return player && player->IsInWorld() ? player : nullptr;
|
||||
}
|
||||
|
||||
WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, uint64 guid)
|
||||
@@ -60,7 +60,7 @@ WorldObject* ObjectAccessor::GetWorldObject(WorldObject const& p, uint64 guid)
|
||||
case HIGHGUID_PET: return GetPet(p, guid);
|
||||
case HIGHGUID_DYNAMICOBJECT: return GetDynamicObject(p, guid);
|
||||
case HIGHGUID_CORPSE: return GetCorpse(p, guid);
|
||||
default: return NULL;
|
||||
default: return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ Object* ObjectAccessor::GetObjectByTypeMask(WorldObject const& p, uint64 guid, u
|
||||
break;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Corpse* ObjectAccessor::GetCorpse(WorldObject const& u, uint64 guid)
|
||||
@@ -115,10 +115,10 @@ GameObject* ObjectAccessor::GetGameObject(WorldObject const& u, uint64 guid)
|
||||
Transport* ObjectAccessor::GetTransport(WorldObject const& u, uint64 guid)
|
||||
{
|
||||
if (GUID_HIPART(guid) != HIGHGUID_MO_TRANSPORT && GUID_HIPART(guid) != HIGHGUID_TRANSPORT)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
GameObject* go = GetGameObject(u, guid);
|
||||
return go ? go->ToTransport() : NULL;
|
||||
return go ? go->ToTransport() : nullptr;
|
||||
}
|
||||
|
||||
DynamicObject* ObjectAccessor::GetDynamicObject(WorldObject const& u, uint64 guid)
|
||||
@@ -154,7 +154,7 @@ Creature* ObjectAccessor::GetCreatureOrPetOrVehicle(WorldObject const& u, uint64
|
||||
if (IS_CRE_OR_VEH_GUID(guid))
|
||||
return GetCreature(u, guid);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Pet* ObjectAccessor::FindPet(uint64 guid)
|
||||
@@ -206,7 +206,7 @@ Player* ObjectAccessor::FindPlayerByName(std::string const& name, bool checkInWo
|
||||
if (!checkInWorld || itr->second->IsInWorld())
|
||||
return itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectAccessor::SaveAllPlayers()
|
||||
@@ -223,7 +223,7 @@ Corpse* ObjectAccessor::GetCorpseForPlayerGUID(uint64 guid)
|
||||
|
||||
Player2CorpsesMapType::iterator iter = i_player2corpse.find(guid);
|
||||
if (iter == i_player2corpse.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
ASSERT(iter->second->GetType() != CORPSE_BONES);
|
||||
|
||||
@@ -321,7 +321,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
|
||||
{
|
||||
//in fact this function is called from several places
|
||||
//even when player doesn't have a corpse, not an error
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
@@ -340,7 +340,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
|
||||
corpse->DeleteFromDB(trans);
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
Corpse* bones = NULL;
|
||||
Corpse* bones = nullptr;
|
||||
// create the bones only if the map and the grid is loaded at the corpse's location
|
||||
// ignore bones creating option in case insignia
|
||||
|
||||
@@ -392,7 +392,7 @@ Corpse* ObjectAccessor::ConvertCorpseForPlayer(uint64 player_guid, bool insignia
|
||||
|
||||
void ObjectAccessor::RemoveOldCorpses()
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
time_t now = time(nullptr);
|
||||
Player2CorpsesMapType::iterator next;
|
||||
for (Player2CorpsesMapType::iterator itr = i_player2corpse.begin(); itr != i_player2corpse.end(); itr = next)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ class HashMapHolder
|
||||
{
|
||||
ACORE_READ_GUARD(LockType, i_lock);
|
||||
typename MapType::iterator itr = m_objectMap.find(guid);
|
||||
return (itr != m_objectMap.end()) ? itr->second : NULL;
|
||||
return (itr != m_objectMap.end()) ? itr->second : nullptr;
|
||||
}
|
||||
|
||||
static MapType& GetContainer() { return m_objectMap; }
|
||||
@@ -139,27 +139,27 @@ class ObjectAccessor
|
||||
if (T * obj = GetObjectInWorld(guid, (T*)NULL))
|
||||
if (obj->GetMap() == map)
|
||||
return obj;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<class T> static T* GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, T* /*fake*/)
|
||||
{
|
||||
T* obj = HashMapHolder<T>::Find(guid);
|
||||
if (!obj || obj->GetMapId() != mapid)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
CellCoord p = acore::ComputeCellCoord(x, y);
|
||||
if (!p.IsCoordValid())
|
||||
{
|
||||
sLog->outError("ObjectAccessor::GetObjectInWorld: invalid coordinates supplied X:%f Y:%f grid cell [%u:%u]", x, y, p.x_coord, p.y_coord);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CellCoord q = acore::ComputeCellCoord(obj->GetPositionX(), obj->GetPositionY());
|
||||
if (!q.IsCoordValid())
|
||||
{
|
||||
sLog->outError("ObjectAccessor::GetObjecInWorld: object (GUID: %u TypeId: %u) has invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), q.x_coord, q.y_coord);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int32 dx = int32(p.x_coord) - int32(q.x_coord);
|
||||
@@ -168,7 +168,7 @@ class ObjectAccessor
|
||||
if (dx > -2 && dx < 2 && dy > -2 && dy < 2)
|
||||
return obj;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// these functions return objects only if in map of specified object
|
||||
|
||||
@@ -56,7 +56,7 @@ std::string GetScriptsTableNameByType(ScriptsType type)
|
||||
|
||||
ScriptMapMap* GetScriptsMapByType(ScriptsType type)
|
||||
{
|
||||
ScriptMapMap* res = NULL;
|
||||
ScriptMapMap* res = nullptr;
|
||||
switch (type)
|
||||
{
|
||||
case SCRIPTS_SPELL: res = &sSpellScripts; break;
|
||||
@@ -171,7 +171,7 @@ LanguageDesc const* GetLanguageDescByID(uint32 lang)
|
||||
return &lang_description[i];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool SpellClickInfo::IsFitToRequirements(Unit const* clicker, Unit const* clickee) const
|
||||
@@ -180,7 +180,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();
|
||||
@@ -228,9 +228,9 @@ ObjectMgr::ObjectMgr():
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_CLASSES; ++i)
|
||||
{
|
||||
_playerClassInfo[i] = NULL;
|
||||
_playerClassInfo[i] = nullptr;
|
||||
for (uint8 j = 0; j < MAX_RACES; ++j)
|
||||
_playerInfo[j][i] = NULL;
|
||||
_playerInfo[j][i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -514,7 +514,7 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||
if (max)
|
||||
{
|
||||
_creatureTemplateStoreFast.clear();
|
||||
_creatureTemplateStoreFast.resize(max+1, NULL);
|
||||
_creatureTemplateStoreFast.resize(max+1, nullptr);
|
||||
for (CreatureTemplateContainer::iterator itr = _creatureTemplateStore.begin(); itr != _creatureTemplateStore.end(); ++itr)
|
||||
_creatureTemplateStoreFast[itr->first] = &(itr->second);
|
||||
}
|
||||
@@ -748,7 +748,7 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
|
||||
sLog->outErrorDb("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)
|
||||
{
|
||||
@@ -1082,7 +1082,7 @@ GameObjectAddon const* ObjectMgr::GetGameObjectAddon(uint32 lowguid)
|
||||
if (itr != _gameObjectAddonStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CreatureAddon const* ObjectMgr::GetCreatureAddon(uint32 lowguid)
|
||||
@@ -1091,7 +1091,7 @@ CreatureAddon const* ObjectMgr::GetCreatureAddon(uint32 lowguid)
|
||||
if (itr != _creatureAddonStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CreatureAddon const* ObjectMgr::GetCreatureTemplateAddon(uint32 entry)
|
||||
@@ -1100,17 +1100,17 @@ CreatureAddon const* ObjectMgr::GetCreatureTemplateAddon(uint32 entry)
|
||||
if (itr != _creatureTemplateAddonStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
EquipmentInfo const* ObjectMgr::GetEquipmentInfo(uint32 entry, int8& id)
|
||||
{
|
||||
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
|
||||
{
|
||||
@@ -1126,7 +1126,7 @@ EquipmentInfo const* ObjectMgr::GetEquipmentInfo(uint32 entry, int8& id)
|
||||
return &itr2->second;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadEquipmentTemplates()
|
||||
@@ -1214,7 +1214,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelInfo(uint32 modelId)
|
||||
if (itr != _creatureModelStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint32 ObjectMgr::ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data /*= NULL*/)
|
||||
@@ -1249,7 +1249,7 @@ CreatureModelInfo const* ObjectMgr::GetCreatureModelRandomGender(uint32* display
|
||||
{
|
||||
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->modelid_other_gender != 0 && urand(0, 1) == 0)
|
||||
@@ -2601,7 +2601,7 @@ void ObjectMgr::LoadItemTemplates()
|
||||
else if (itemTemplate.Spells[1].SpellId != -1)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[1].SpellId);
|
||||
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[1].SpellId, NULL))
|
||||
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[1].SpellId, nullptr))
|
||||
{
|
||||
sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, 1+1, itemTemplate.Spells[1].SpellId);
|
||||
itemTemplate.Spells[0].SpellId = 0;
|
||||
@@ -2649,7 +2649,7 @@ void ObjectMgr::LoadItemTemplates()
|
||||
if (itemTemplate.Spells[j].SpellId && itemTemplate.Spells[j].SpellId != -1)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itemTemplate.Spells[j].SpellId);
|
||||
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[j].SpellId, NULL))
|
||||
if (!spellInfo && !DisableMgr::IsDisabledFor(DISABLE_TYPE_SPELL, itemTemplate.Spells[j].SpellId, nullptr))
|
||||
{
|
||||
sLog->outErrorDb("Item (Entry: %u) has wrong (not existing) spell in spellid_%d (%d)", entry, j+1, itemTemplate.Spells[j].SpellId);
|
||||
itemTemplate.Spells[j].SpellId = 0;
|
||||
@@ -2806,7 +2806,7 @@ void ObjectMgr::LoadItemTemplates()
|
||||
if (max)
|
||||
{
|
||||
_itemTemplateStoreFast.clear();
|
||||
_itemTemplateStoreFast.resize(max+1, NULL);
|
||||
_itemTemplateStoreFast.resize(max+1, nullptr);
|
||||
for (ItemTemplateContainer::iterator itr = _itemTemplateStore.begin(); itr != _itemTemplateStore.end(); ++itr)
|
||||
_itemTemplateStoreFast[itr->first] = &(itr->second);
|
||||
}
|
||||
@@ -2844,7 +2844,7 @@ void ObjectMgr::LoadItemTemplates()
|
||||
|
||||
ItemTemplate const* ObjectMgr::GetItemTemplate(uint32 entry)
|
||||
{
|
||||
return entry < _itemTemplateStoreFast.size() ? _itemTemplateStoreFast[entry] : NULL;
|
||||
return entry < _itemTemplateStoreFast.size() ? _itemTemplateStoreFast[entry] : nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadItemSetNameLocales()
|
||||
@@ -3113,7 +3113,7 @@ void ObjectMgr::LoadPetLevelInfo()
|
||||
|
||||
PetLevelInfo*& pInfoMapEntry = _petInfoStore[creature_id];
|
||||
|
||||
if (pInfoMapEntry == NULL)
|
||||
if (pInfoMapEntry == nullptr)
|
||||
pInfoMapEntry = new PetLevelInfo[sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL)];
|
||||
|
||||
// data for level 1 stored in [0] array element, ...
|
||||
@@ -3167,7 +3167,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, ...
|
||||
}
|
||||
@@ -3903,7 +3903,7 @@ void ObjectMgr::LoadQuests()
|
||||
if (max)
|
||||
{
|
||||
_questTemplatesFast.clear();
|
||||
_questTemplatesFast.resize(max+1, NULL);
|
||||
_questTemplatesFast.resize(max+1, nullptr);
|
||||
for (QuestMap::iterator itr = _questTemplates.begin(); itr != _questTemplates.end(); ++itr)
|
||||
_questTemplatesFast[itr->first] = itr->second;
|
||||
}
|
||||
@@ -4008,7 +4008,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;
|
||||
@@ -5211,7 +5211,7 @@ PageText const* ObjectMgr::GetPageText(uint32 pageEntry)
|
||||
if (itr != _pageTextStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadPageTextLocales()
|
||||
@@ -5293,7 +5293,7 @@ InstanceTemplate const* ObjectMgr::GetInstanceTemplate(uint32 mapID)
|
||||
if (itr != _instanceTemplateStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadInstanceEncounters()
|
||||
@@ -5386,7 +5386,7 @@ GossipText const* ObjectMgr::GetGossipText(uint32 Text_ID) const
|
||||
GossipTextContainer::const_iterator itr = _gossipTextStore.find(Text_ID);
|
||||
if (itr != _gossipTextStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadGossipText()
|
||||
@@ -5508,7 +5508,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
time_t curTime = time(NULL);
|
||||
time_t curTime = time(nullptr);
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_EXPIRED_MAIL);
|
||||
stmt->setUInt32(0, curTime);
|
||||
@@ -5549,7 +5549,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::FindPlayerInOrOutOfWorld(MAKE_NEW_GUID(m->receiver, 0, HIGHGUID_PLAYER));
|
||||
|
||||
@@ -6150,14 +6150,14 @@ AreaTriggerTeleport const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
|
||||
uint32 parentId = 0;
|
||||
const MapEntry* mapEntry = sMapStore.LookupEntry(Map);
|
||||
if (!mapEntry || mapEntry->entrance_map < 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;
|
||||
@@ -6171,7 +6171,7 @@ AreaTriggerTeleport const* ObjectMgr::GetGoBackTrigger(uint32 Map) const
|
||||
if (atEntry && atEntry->map == Map)
|
||||
return &itr->second;
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6189,7 +6189,7 @@ AreaTriggerTeleport const* ObjectMgr::GetMapEntranceTrigger(uint32 Map) const
|
||||
return &itr->second;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void ObjectMgr::SetHighestGuids()
|
||||
@@ -8010,13 +8010,13 @@ 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;
|
||||
const GameTele* alt = nullptr;
|
||||
for (GameTeleContainer::const_iterator itr = _gameTeleStore.begin(); itr != _gameTeleStore.end(); ++itr)
|
||||
{
|
||||
if (itr->second.wnameLow == wname)
|
||||
@@ -9124,7 +9124,7 @@ GameObjectTemplate const* ObjectMgr::GetGameObjectTemplate(uint32 entry)
|
||||
if (itr != _gameObjectTemplateStore.end())
|
||||
return &(itr->second);
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Player* ObjectMgr::GetPlayerByLowGUID(uint32 lowguid) const
|
||||
@@ -9150,7 +9150,7 @@ GameObjectTemplateAddon const* ObjectMgr::GetGameObjectTemplateAddon(uint32 entr
|
||||
|
||||
CreatureTemplate const* ObjectMgr::GetCreatureTemplate(uint32 entry)
|
||||
{
|
||||
return entry < _creatureTemplateStoreFast.size() ? _creatureTemplateStoreFast[entry] : NULL;
|
||||
return entry < _creatureTemplateStoreFast.size() ? _creatureTemplateStoreFast[entry] : nullptr;
|
||||
}
|
||||
|
||||
VehicleAccessoryList const* ObjectMgr::GetVehicleAccessoryList(Vehicle* veh) const
|
||||
@@ -9167,18 +9167,18 @@ VehicleAccessoryList const* ObjectMgr::GetVehicleAccessoryList(Vehicle* veh) con
|
||||
VehicleAccessoryContainer::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;
|
||||
}
|
||||
|
||||
|
||||
@@ -732,8 +732,8 @@ class ObjectMgr
|
||||
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, uint32& npcflag, uint32& unit_flags, uint32& dynamicflags, CreatureData const* data = NULL);
|
||||
static uint32 ChooseDisplayId(CreatureTemplate const* cinfo, CreatureData const* data = nullptr);
|
||||
static void ChooseCreatureFlags(CreatureTemplate const* cinfo, uint32& npcflag, uint32& unit_flags, uint32& dynamicflags, CreatureData const* data = nullptr);
|
||||
EquipmentInfo const* GetEquipmentInfo(uint32 entry, int8& id);
|
||||
CreatureAddon const* GetCreatureAddon(uint32 lowguid);
|
||||
GameObjectAddon const* GetGameObjectAddon(uint32 lowguid);
|
||||
@@ -748,7 +748,7 @@ class ObjectMgr
|
||||
ItemSetNameContainer::iterator itr = _itemSetNameStore.find(itemId);
|
||||
if (itr != _itemSetNameStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
InstanceTemplate const* GetInstanceTemplate(uint32 mapId);
|
||||
@@ -758,7 +758,7 @@ class ObjectMgr
|
||||
PlayerClassInfo const* GetPlayerClassInfo(uint32 class_) const
|
||||
{
|
||||
if (class_ >= MAX_CLASSES)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return _playerClassInfo[class_];
|
||||
}
|
||||
void GetPlayerClassLevelInfo(uint32 class_, uint8 level, PlayerClassLevelInfo* info) const;
|
||||
@@ -782,7 +782,7 @@ class 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; }
|
||||
|
||||
@@ -791,13 +791,13 @@ class 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; }
|
||||
|
||||
Quest const* GetQuestTemplate(uint32 quest_id) const
|
||||
{
|
||||
return quest_id < _questTemplatesFast.size() ? _questTemplatesFast[quest_id] : NULL;
|
||||
return quest_id < _questTemplatesFast.size() ? _questTemplatesFast[quest_id] : nullptr;
|
||||
}
|
||||
|
||||
QuestMap const& GetQuestTemplates() const { return _questTemplates; }
|
||||
@@ -822,7 +822,7 @@ class ObjectMgr
|
||||
AreaTriggerContainer::const_iterator itr = _areaTriggerStore.find(trigger);
|
||||
if (itr != _areaTriggerStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AreaTriggerTeleport const* GetAreaTriggerTeleport(uint32 trigger) const
|
||||
@@ -830,7 +830,7 @@ class ObjectMgr
|
||||
AreaTriggerTeleportContainer::const_iterator itr = _areaTriggerTeleportStore.find(trigger);
|
||||
if (itr != _areaTriggerTeleportStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AccessRequirement const* GetAccessRequirement(uint32 mapid, Difficulty difficulty) const
|
||||
@@ -838,7 +838,7 @@ class ObjectMgr
|
||||
AccessRequirementContainer::const_iterator itr = _accessRequirementStore.find(MAKE_PAIR32(mapid, difficulty));
|
||||
if (itr != _accessRequirementStore.end())
|
||||
return itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AreaTriggerTeleport const* GetGoBackTrigger(uint32 Map) const;
|
||||
@@ -853,7 +853,7 @@ class ObjectMgr
|
||||
if (itr != _repRewardRateStore.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ReputationOnKillEntry const* GetReputationOnKilEntry(uint32 id) const
|
||||
@@ -861,7 +861,7 @@ class 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);
|
||||
@@ -872,7 +872,7 @@ class ObjectMgr
|
||||
if (itr != _repSpilloverTemplateStore.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PointOfInterest const* GetPointOfInterest(uint32 id) const
|
||||
@@ -880,7 +880,7 @@ class ObjectMgr
|
||||
PointOfInterestContainer::const_iterator itr = _pointsOfInterestStore.find(id);
|
||||
if (itr != _pointsOfInterestStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QuestPOIVector const* GetQuestPOIVector(uint32 questId)
|
||||
@@ -888,7 +888,7 @@ class 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;
|
||||
@@ -898,7 +898,7 @@ class ObjectMgr
|
||||
std::unordered_map<uint32, DungeonEncounterList>::const_iterator itr = _dungeonEncounterStore.find(MAKE_PAIR32(mapId, difficulty));
|
||||
if (itr != _dungeonEncounterStore.end())
|
||||
return &itr->second;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void LoadQuests();
|
||||
@@ -1074,13 +1074,13 @@ class 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)
|
||||
@@ -1118,7 +1118,7 @@ class ObjectMgr
|
||||
if (itr != _tempSummonDataStore.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
BroadcastText const* GetBroadcastText(uint32 id) const
|
||||
@@ -1131,7 +1131,7 @@ class ObjectMgr
|
||||
CreatureData const* GetCreatureData(uint32 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(uint32 guid) { return _creatureDataStore[guid]; }
|
||||
@@ -1146,55 +1146,55 @@ class ObjectMgr
|
||||
GameObjectData const* GetGOData(uint32 guid) const
|
||||
{
|
||||
GameObjectDataContainer::const_iterator itr = _gameObjectDataStore.find(guid);
|
||||
if (itr == _gameObjectDataStore.end()) return NULL;
|
||||
if (itr == _gameObjectDataStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
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;
|
||||
}
|
||||
ItemLocale const* GetItemLocale(uint32 entry) const
|
||||
{
|
||||
ItemLocaleContainer::const_iterator itr = _itemLocaleStore.find(entry);
|
||||
if (itr == _itemLocaleStore.end()) return NULL;
|
||||
if (itr == _itemLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
ItemSetNameLocale const* GetItemSetNameLocale(uint32 entry) const
|
||||
{
|
||||
ItemSetNameLocaleContainer::const_iterator itr = _itemSetNameLocaleStore.find(entry);
|
||||
if (itr == _itemSetNameLocaleStore.end())return NULL;
|
||||
if (itr == _itemSetNameLocaleStore.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;
|
||||
}
|
||||
QuestLocale const* GetQuestLocale(uint32 entry) const
|
||||
{
|
||||
QuestLocaleContainer::const_iterator itr = _questLocaleStore.find(entry);
|
||||
if (itr == _questLocaleStore.end()) return NULL;
|
||||
if (itr == _questLocaleStore.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 poi_id) const
|
||||
{
|
||||
PointOfInterestLocaleContainer::const_iterator itr = _pointOfInterestLocaleStore.find(poi_id);
|
||||
if (itr == _pointOfInterestLocaleStore.end()) return NULL;
|
||||
if (itr == _pointOfInterestLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
QuestOfferRewardLocale const* GetQuestOfferRewardLocale(uint32 entry) const
|
||||
@@ -1212,7 +1212,7 @@ class ObjectMgr
|
||||
NpcTextLocale const* GetNpcTextLocale(uint32 entry) const
|
||||
{
|
||||
NpcTextLocaleContainer::const_iterator itr = _npcTextLocaleStore.find(entry);
|
||||
if (itr == _npcTextLocaleStore.end()) return NULL;
|
||||
if (itr == _npcTextLocaleStore.end()) return nullptr;
|
||||
return &itr->second;
|
||||
}
|
||||
GameObjectData& NewGOData(uint32 guid) { return _gameObjectDataStore[guid]; }
|
||||
@@ -1222,7 +1222,7 @@ class ObjectMgr
|
||||
{
|
||||
AcoreStringContainer::const_iterator itr = _acoreStringStore.find(entry);
|
||||
if (itr == _acoreStringStore.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return &itr->second;
|
||||
}
|
||||
@@ -1258,7 +1258,7 @@ class 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;
|
||||
@@ -1270,7 +1270,7 @@ class ObjectMgr
|
||||
{
|
||||
CacheTrainerSpellContainer::const_iterator iter = _cacheTrainerSpellStore.find(entry);
|
||||
if (iter == _cacheTrainerSpellStore.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return &iter->second;
|
||||
}
|
||||
@@ -1279,7 +1279,7 @@ class ObjectMgr
|
||||
{
|
||||
CacheVendorItemContainer::const_iterator iter = _cacheVendorItemStore.find(entry);
|
||||
if (iter == _cacheVendorItemStore.end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return &iter->second;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user