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:
Kitzunu
2020-08-31 11:55:09 +02:00
committed by GitHub
parent 38903b5dfb
commit 1f89282b22
325 changed files with 2348 additions and 2348 deletions

View File

@@ -86,7 +86,7 @@ void BattlegroundMgr::Update(uint32 diff)
bg->Update(diff);
if (bg->ToBeDeleted())
{
itrDelete->second = NULL;
itrDelete->second = nullptr;
m_Battlegrounds.erase(itrDelete);
delete bg;
}
@@ -134,7 +134,7 @@ void BattlegroundMgr::Update(uint32 diff)
{
if (m_AutoDistributionTimeChecker < diff)
{
if (time(NULL) > m_NextAutoDistributionTime)
if (time(nullptr) > m_NextAutoDistributionTime)
{
sArenaTeamMgr->DistributeArenaPoints();
m_NextAutoDistributionTime = m_NextAutoDistributionTime + BATTLEGROUND_ARENA_POINT_DISTRIBUTION_DAY * sWorld->getIntConfig(CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS);
@@ -407,13 +407,13 @@ void BattlegroundMgr::BuildPlayerJoinedBattlegroundPacket(WorldPacket* data, Pla
Battleground* BattlegroundMgr::GetBattleground(uint32 instanceId)
{
if (!instanceId)
return NULL;
return nullptr;
BattlegroundContainer::const_iterator itr = m_Battlegrounds.find(instanceId);
if (itr != m_Battlegrounds.end())
return itr->second;
return NULL;
return nullptr;
}
Battleground* BattlegroundMgr::GetBattlegroundTemplate(BattlegroundTypeId bgTypeId)
@@ -422,7 +422,7 @@ Battleground* BattlegroundMgr::GetBattlegroundTemplate(BattlegroundTypeId bgType
if (itr != m_BattlegroundTemplates.end())
return itr->second;
return NULL;
return nullptr;
}
uint32 BattlegroundMgr::GetNextClientVisibleInstanceId()
@@ -441,12 +441,12 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId original
// get the template BG
Battleground* bg_template = GetBattlegroundTemplate(bgTypeId);
if (!bg_template)
return NULL;
return nullptr;
Battleground* bg = NULL;
Battleground* bg = nullptr;
// create a copy of the BG template
if (BattlegroundMgr::bgTypeToTemplate.find(bgTypeId) == BattlegroundMgr::bgTypeToTemplate.end()) {
return NULL;
return nullptr;
}
bg = BattlegroundMgr::bgTypeToTemplate[bgTypeId](bg_template);
@@ -491,10 +491,10 @@ Battleground* BattlegroundMgr::CreateNewBattleground(BattlegroundTypeId original
bool BattlegroundMgr::CreateBattleground(CreateBattlegroundData& data)
{
// Create the BG
Battleground* bg = NULL;
Battleground* bg = nullptr;
bg = BattlegroundMgr::bgtypeToBattleground[data.bgTypeId];
if (bg == NULL)
if (bg == nullptr)
return false;
if (data.bgTypeId == BATTLEGROUND_RB)
@@ -542,7 +542,7 @@ void BattlegroundMgr::CreateInitialBattlegrounds()
uint32 bgTypeId = fields[0].GetUInt32();
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeId, NULL))
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_BATTLEGROUND, bgTypeId, nullptr))
continue;
// can be overwrite by values from DB
@@ -645,7 +645,7 @@ void BattlegroundMgr::InitAutomaticArenaPointDistribution()
return;
time_t wstime = time_t(sWorld->getWorldState(WS_ARENA_DISTRIBUTION_TIME));
time_t curtime = time(NULL);
time_t curtime = time(nullptr);
sLog->outString("AzerothCore Battleground: Initializing Automatic Arena Point Distribution");
if (wstime < curtime)
{