aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/Map.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2020-08-14 17:06:03 +0200
committerShauren <shauren.trinity@gmail.com>2020-08-14 17:06:03 +0200
commit1c52d5fff738aa01bd27fd117076ac33515acef5 (patch)
treeff7d2113e023a0fd47fbdde8ea94c0fe4bb9a804 /src/server/game/Maps/Map.cpp
parent02fd3a1f15840203d8515dae12920d9b66655076 (diff)
Core/Misc: Replace NULL with nullptr
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rw-r--r--src/server/game/Maps/Map.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index fa2b4ec1508..5bee032d2c2 100644
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -460,7 +460,7 @@ void Map::SwitchGridContainers(Creature* obj, bool on)
}
NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY());
- ASSERT(ngrid != NULL);
+ ASSERT(ngrid != nullptr);
GridType &grid = ngrid->GetGridType(cell.CellX(), cell.CellY());
@@ -505,7 +505,7 @@ void Map::SwitchGridContainers(GameObject* obj, bool on)
}
NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY());
- ASSERT(ngrid != NULL);
+ ASSERT(ngrid != nullptr);
GridType &grid = ngrid->GetGridType(cell.CellX(), cell.CellY());
@@ -596,7 +596,7 @@ void Map::EnsureGridLoadedForActiveObject(const Cell &cell, WorldObject* object)
{
EnsureGridLoaded(cell);
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
- ASSERT(grid != NULL);
+ ASSERT(grid != nullptr);
// refresh grid state & timer
if (grid->GetGridState() != GRID_STATE_ACTIVE)
@@ -613,7 +613,7 @@ bool Map::EnsureGridLoaded(const Cell &cell)
EnsureGridCreated(GridCoord(cell.GridX(), cell.GridY()));
NGridType *grid = getNGrid(cell.GridX(), cell.GridY());
- ASSERT(grid != NULL);
+ ASSERT(grid != nullptr);
if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY()))
{
TC_LOG_DEBUG("maps", "Loading grid[%u, %u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId);
@@ -1885,7 +1885,7 @@ bool Map::UnloadGrid(NGridType& ngrid, bool unloadAll)
ASSERT(i_objectsToRemove.empty());
delete &ngrid;
- setNGrid(NULL, x, y);
+ setNGrid(nullptr, x, y);
}
int gx = (MAX_NUMBER_OF_GRIDS - 1) - x;
int gy = (MAX_NUMBER_OF_GRIDS - 1) - y;
@@ -3495,7 +3495,7 @@ template TC_GAME_API void Map::RemoveFromMap(Conversation*, bool);
InstanceMap::InstanceMap(uint32 id, time_t expiry, uint32 InstanceId, Difficulty SpawnMode, Map* _parent)
: Map(id, expiry, InstanceId, SpawnMode, _parent),
m_resetAfterUnload(false), m_unloadWhenEmpty(false),
- i_data(NULL), i_script_id(0), i_scenario(nullptr)
+ i_data(nullptr), i_script_id(0), i_scenario(nullptr)
{
//lets initialize visibility distance for dungeons
InstanceMap::InitVisibilityDistance();
@@ -3577,7 +3577,7 @@ bool InstanceMap::AddPlayerToMap(Player* player, bool initPlayer /*= true*/)
// increase current instances (hourly limit)
if (!group || !group->isLFGGroup())
- player->AddInstanceEnterTime(GetInstanceId(), time(NULL));
+ player->AddInstanceEnterTime(GetInstanceId(), time(nullptr));
// get or create an instance save for the map
InstanceSave* mapSave = sInstanceSaveMgr->GetInstanceSave(GetInstanceId());
@@ -3709,7 +3709,7 @@ void InstanceMap::RemovePlayerFromMap(Player* player, bool remove)
void InstanceMap::CreateInstanceData(bool load)
{
- if (i_data != NULL)
+ if (i_data != nullptr)
return;
InstanceTemplate const* mInstance = sObjectMgr->GetInstanceTemplate(GetId());
@@ -3999,7 +3999,7 @@ uint32 InstanceMap::GetMaxResetDelay() const
/* ******* Battleground Instance Maps ******* */
BattlegroundMap::BattlegroundMap(uint32 id, time_t expiry, uint32 InstanceId, Map* _parent, Difficulty spawnMode)
- : Map(id, expiry, InstanceId, spawnMode, _parent), m_bg(NULL)
+ : Map(id, expiry, InstanceId, spawnMode, _parent), m_bg(nullptr)
{
//lets initialize visibility distance for BG/Arenas
BattlegroundMap::InitVisibilityDistance();
@@ -4010,8 +4010,8 @@ BattlegroundMap::~BattlegroundMap()
if (m_bg)
{
//unlink to prevent crash, always unlink all pointer reference before destruction
- m_bg->SetBgMap(NULL);
- m_bg = NULL;
+ m_bg->SetBgMap(nullptr);
+ m_bg = nullptr;
}
}
@@ -4115,10 +4115,10 @@ Pet* Map::GetPet(ObjectGuid const& guid)
Transport* Map::GetTransport(ObjectGuid const& guid)
{
if (!guid.IsMOTransport())
- return NULL;
+ return nullptr;
GameObject* go = GetGameObject(guid);
- return go ? go->ToTransport() : NULL;
+ return go ? go->ToTransport() : nullptr;
}
void Map::UpdateIteratorBack(Player* player)
@@ -4370,7 +4370,7 @@ Corpse* Map::ConvertCorpseToBones(ObjectGuid const& ownerGuid, 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