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

@@ -41,7 +41,7 @@ namespace acore
class BattlegroundChatBuilder
{
public:
BattlegroundChatBuilder(ChatMsg msgtype, uint32 textId, Player const* source, va_list* args = NULL)
BattlegroundChatBuilder(ChatMsg msgtype, uint32 textId, Player const* source, va_list* args = nullptr)
: _msgtype(msgtype), _textId(textId), _source(source), _args(args) { }
void operator()(WorldPacket& data, LocaleConstant loc_idx)
@@ -138,7 +138,7 @@ Battleground::Battleground()
m_MinPlayersPerTeam = 0;
m_MapId = 0;
m_Map = NULL;
m_Map = nullptr;
m_StartMaxDist = 0.0f;
ScriptId = 0;
@@ -163,8 +163,8 @@ Battleground::Battleground()
m_ArenaTeamMMR[TEAM_ALLIANCE] = 0;
m_ArenaTeamMMR[TEAM_HORDE] = 0;
m_BgRaids[TEAM_ALLIANCE] = NULL;
m_BgRaids[TEAM_HORDE] = NULL;
m_BgRaids[TEAM_ALLIANCE] = nullptr;
m_BgRaids[TEAM_HORDE] = nullptr;
m_PlayersCount[TEAM_ALLIANCE] = 0;
m_PlayersCount[TEAM_HORDE] = 0;
@@ -216,8 +216,8 @@ Battleground::~Battleground()
{
m_Map->SetUnload();
//unlink to prevent crash, always unlink all pointer reference before destruction
m_Map->SetBG(NULL);
m_Map = NULL;
m_Map->SetBG(nullptr);
m_Map = nullptr;
}
for (BattlegroundScoreMap::const_iterator itr = PlayerScores.begin(); itr != PlayerScores.end(); ++itr)
@@ -329,7 +329,7 @@ inline void Battleground::_ProcessResurrect(uint32 diff)
{
for (std::map<uint64, std::vector<uint64> >::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
{
Creature* sh = NULL;
Creature* sh = nullptr;
for (std::vector<uint64>::const_iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
{
Player* player = ObjectAccessor::FindPlayer(*itr2);
@@ -741,8 +741,8 @@ void Battleground::EndBattleground(TeamId winnerTeamId)
bool bValidArena = isArena() && isRated() && GetStatus() == STATUS_IN_PROGRESS && GetStartTime() >= startDelay+15000; // pussywizard: only if arena lasted at least 15 secs
SetStatus(STATUS_WAIT_LEAVE);
ArenaTeam* winnerArenaTeam = NULL;
ArenaTeam* loserArenaTeam = NULL;
ArenaTeam* winnerArenaTeam = nullptr;
ArenaTeam* loserArenaTeam = nullptr;
uint32 loserTeamRating = 0;
uint32 loserMatchmakerRating = 0;
@@ -770,7 +770,7 @@ void Battleground::EndBattleground(TeamId winnerTeamId)
else
SetWinner(TEAM_NEUTRAL);
PreparedStatement* stmt = NULL;
PreparedStatement* stmt = nullptr;
uint64 battlegroundId = 1;
if (isBattleground() && sWorld->getBoolConfig(CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE))
{
@@ -1133,7 +1133,7 @@ void Battleground::RemovePlayerAtLeave(Player* player)
if (Group* group = GetBgRaid(teamId))
if (group->IsMember(player->GetGUID()))
if (!group->RemoveMember(player->GetGUID())) // group was disbanded
SetBgRaid(teamId, NULL);
SetBgRaid(teamId, nullptr);
// let others know
sBattlegroundMgr->BuildPlayerLeftBattlegroundPacket(&data, player->GetGUID());
@@ -1422,7 +1422,7 @@ void Battleground::UpdatePlayerScore(Player* player, uint32 type, uint32 value,
{
// reward honor instantly
if (doAddHonor)
player->RewardHonor(NULL, 1, value); // RewardHonor calls UpdatePlayerScore with doAddHonor = false
player->RewardHonor(nullptr, 1, value); // RewardHonor calls UpdatePlayerScore with doAddHonor = false
else
itr->second->BonusHonor += value;
}
@@ -1482,7 +1482,7 @@ void Battleground::RelocateDeadPlayers(uint64 queueIndex)
std::vector<uint64>& ghostList = m_ReviveQueue[queueIndex];
if (!ghostList.empty())
{
GraveyardStruct const* closestGrave = NULL;
GraveyardStruct const* closestGrave = nullptr;
for (std::vector<uint64>::const_iterator itr = ghostList.begin(); itr != ghostList.end(); ++itr)
{
Player* player = ObjectAccessor::FindPlayer(*itr);
@@ -1624,7 +1624,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
Map* map = FindBgMap();
if (!map)
return NULL;
return nullptr;
if (transport)
{
@@ -1636,7 +1636,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
return creature;
}
return NULL;
return nullptr;
}
Creature* creature = new Creature();
@@ -1645,7 +1645,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
sLog->outError("Battleground::AddCreature: cannot create creature (entry: %u) for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
delete creature;
return NULL;
return nullptr;
}
creature->SetHomePosition(x, y, z, o);
@@ -1656,7 +1656,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
sLog->outError("Battleground::AddCreature: creature template (entry: %u) does not exist for BG (map: %u, instance id: %u)!",
entry, m_MapId, m_InstanceID);
delete creature;
return NULL;
return nullptr;
}
// Force using DB speeds
creature->SetSpeed(MOVE_WALK, cinfo->speed_walk);
@@ -1665,7 +1665,7 @@ Creature* Battleground::AddCreature(uint32 entry, uint32 type, float x, float y,
if (!map->AddToMap(creature))
{
delete creature;
return NULL;
return nullptr;
}
BgCreatures[type] = creature->GetGUID();
@@ -1783,7 +1783,7 @@ void Battleground::SendWarningToAll(uint32 entry, ...)
vsnprintf(str, 1024, format, ap);
va_end(ap);
ChatHandler::BuildChatPacket(localizedPackets[itr->second->GetSession()->GetSessionDbLocaleIndex()], CHAT_MSG_RAID_BOSS_EMOTE, LANG_UNIVERSAL, NULL, NULL, str);
ChatHandler::BuildChatPacket(localizedPackets[itr->second->GetSession()->GetSessionDbLocaleIndex()], CHAT_MSG_RAID_BOSS_EMOTE, LANG_UNIVERSAL, nullptr, nullptr, str);
}
itr->second->SendDirectMessage(&localizedPackets[itr->second->GetSession()->GetSessionDbLocaleIndex()]);
@@ -1956,7 +1956,7 @@ void Battleground::SetBgRaid(TeamId teamId, Group* bg_raid)
{
Group*& old_raid = m_BgRaids[teamId];
if (old_raid)
old_raid->SetBattlegroundGroup(NULL);
old_raid->SetBattlegroundGroup(nullptr);
if (bg_raid)
bg_raid->SetBattlegroundGroup(this);
old_raid = bg_raid;