mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-17 09:14:34 +00:00
refactor(Core): replace NULL with nullptr (#4593)
This commit is contained in:
@@ -185,11 +185,11 @@ void Map::LoadMap(int gx, int gy, bool reload)
|
||||
sScriptMgr->OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy);
|
||||
|
||||
delete (GridMaps[gx][gy]);
|
||||
GridMaps[gx][gy] = NULL;
|
||||
GridMaps[gx][gy] = nullptr;
|
||||
}
|
||||
|
||||
// map file name
|
||||
char* tmp = NULL;
|
||||
char* tmp = nullptr;
|
||||
int len = sWorld->GetDataPath().length() + strlen("maps/%03u%02u%02u.map") + 1;
|
||||
tmp = new char[len];
|
||||
snprintf(tmp, len, (char*)(sWorld->GetDataPath() + "maps/%03u%02u%02u.map").c_str(), GetId(), gx, gy);
|
||||
@@ -229,7 +229,7 @@ Map::Map(uint32 id, uint32 InstanceId, uint8 SpawnMode, Map* _parent) :
|
||||
for (unsigned int j = 0; j < MAX_NUMBER_OF_GRIDS; ++j)
|
||||
{
|
||||
//z code
|
||||
GridMaps[idx][j] = NULL;
|
||||
GridMaps[idx][j] = nullptr;
|
||||
setNGrid(nullptr, idx, j);
|
||||
}
|
||||
}
|
||||
@@ -1909,7 +1909,7 @@ GridMap* Map::GetGrid(float x, float y)
|
||||
return GridMaps[gx][gy];
|
||||
}
|
||||
|
||||
float Map::GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float* ground /*= NULL*/, bool /*swim = false*/, float collisionHeight) const
|
||||
float Map::GetWaterOrGroundLevel(uint32 phasemask, float x, float y, float z, float* ground /*= nullptr*/, bool /*swim = false*/, float collisionHeight) const
|
||||
{
|
||||
if (const_cast<Map*>(this)->GetGrid(x, y))
|
||||
{
|
||||
@@ -3056,17 +3056,17 @@ void BattlegroundMap::RemoveAllPlayers()
|
||||
|
||||
Player* Map::GetPlayer(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Player*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Player*)nullptr);
|
||||
}
|
||||
|
||||
Creature* Map::GetCreature(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Creature*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Creature*)nullptr);
|
||||
}
|
||||
|
||||
GameObject* Map::GetGameObject(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (GameObject*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (GameObject*)nullptr);
|
||||
}
|
||||
|
||||
Transport* Map::GetTransport(uint64 guid)
|
||||
@@ -3080,17 +3080,17 @@ Transport* Map::GetTransport(uint64 guid)
|
||||
|
||||
DynamicObject* Map::GetDynamicObject(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (DynamicObject*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (DynamicObject*)nullptr);
|
||||
}
|
||||
|
||||
Pet* Map::GetPet(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Pet*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Pet*)nullptr);
|
||||
}
|
||||
|
||||
Corpse* Map::GetCorpse(uint64 guid)
|
||||
{
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Corpse*)NULL);
|
||||
return ObjectAccessor::GetObjectInMap(guid, this, (Corpse*)nullptr);
|
||||
}
|
||||
|
||||
void Map::UpdateIteratorBack(Player* player)
|
||||
|
||||
@@ -165,7 +165,7 @@ Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player)
|
||||
uint32 newInstanceId = sMapMgr->GenerateInstanceId();
|
||||
ASSERT(!FindInstanceMap(newInstanceId)); // pussywizard: instance with new id can't exist
|
||||
Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid());
|
||||
map = CreateInstance(newInstanceId, NULL, diff);
|
||||
map = CreateInstance(newInstanceId, nullptr, diff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
Map* FindInstanceMap(uint32 instanceId) const
|
||||
{
|
||||
InstancedMaps::const_iterator i = m_InstancedMaps.find(instanceId);
|
||||
return(i == m_InstancedMaps.end() ? NULL : i->second);
|
||||
return(i == m_InstancedMaps.end() ? nullptr : i->second);
|
||||
}
|
||||
bool DestroyInstance(InstancedMaps::iterator& itr);
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
Map* FindBaseMap(uint32 mapId) const // pussywizard: need this public for movemaps (mmaps)
|
||||
{
|
||||
MapMapType::const_iterator iter = i_maps.find(mapId);
|
||||
return (iter == i_maps.end() ? NULL : iter->second);
|
||||
return (iter == i_maps.end() ? nullptr : iter->second);
|
||||
}
|
||||
|
||||
uint32 GetAreaId(uint32 mapid, float x, float y, float z) const
|
||||
|
||||
@@ -344,7 +344,7 @@ void TransportMgr::AddPathNodeToTransport(uint32 transportEntry, uint32 timeSeg,
|
||||
animNode.Path[timeSeg] = node;
|
||||
}
|
||||
|
||||
MotionTransport* TransportMgr::CreateTransport(uint32 entry, uint32 guid /*= 0*/, Map* map /*= NULL*/)
|
||||
MotionTransport* TransportMgr::CreateTransport(uint32 entry, uint32 guid /*= 0*/, Map* map /*= nullptr*/)
|
||||
{
|
||||
// instance case, execute GetGameObjectEntry hook
|
||||
if (map)
|
||||
|
||||
Reference in New Issue
Block a user