aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/DungeonFinding/LFGMgr.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/DungeonFinding/LFGMgr.cpp
parent02fd3a1f15840203d8515dae12920d9b66655076 (diff)
Core/Misc: Replace NULL with nullptr
Diffstat (limited to 'src/server/game/DungeonFinding/LFGMgr.cpp')
-rw-r--r--src/server/game/DungeonFinding/LFGMgr.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index a85252c4806..b224af5f9c7 100644
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -137,7 +137,7 @@ void LFGMgr::LoadRewards()
uint32 count = 0;
- Field* fields = NULL;
+ Field* fields = nullptr;
do
{
fields = result->Fetch();
@@ -184,7 +184,7 @@ LFGDungeonData const* LFGMgr::GetLFGDungeon(uint32 id)
if (itr != LfgDungeonStore.end())
return &(itr->second);
- return NULL;
+ return nullptr;
}
void LFGMgr::LoadLFGDungeons(bool reload /* = false */)
@@ -287,7 +287,7 @@ void LFGMgr::Update(uint32 diff)
if (!isOptionEnabled(LFG_OPTION_ENABLE_DUNGEON_FINDER | LFG_OPTION_ENABLE_RAID_BROWSER))
return;
- time_t currTime = time(NULL);
+ time_t currTime = time(nullptr);
// Remove obsolete role checks
for (LfgRoleCheckContainer::iterator it = RoleChecksStore.begin(); it != RoleChecksStore.end();)
@@ -441,7 +441,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
else
{
uint8 memberCount = 0;
- for (GroupReference* itr = grp->GetFirstMember(); itr != NULL && joinData.result == LFG_JOIN_OK; itr = itr->next())
+ for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr && joinData.result == LFG_JOIN_OK; itr = itr->next())
{
if (Player* plrg = itr->GetSource())
{
@@ -546,7 +546,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
{
// Create new rolecheck
LfgRoleCheck& roleCheck = RoleChecksStore[gguid];
- roleCheck.cancelTime = time_t(time(NULL)) + LFG_TIME_ROLECHECK;
+ roleCheck.cancelTime = time_t(time(nullptr)) + LFG_TIME_ROLECHECK;
roleCheck.state = LFG_ROLECHECK_INITIALITING;
roleCheck.leader = guid;
roleCheck.dungeons = dungeons;
@@ -561,7 +561,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
SetState(gguid, LFG_STATE_ROLECHECK);
// Send update to player
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_JOIN_QUEUE, dungeons);
- for (GroupReference* itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = grp->GetFirstMember(); itr != nullptr; itr = itr->next())
{
if (Player* plrg = itr->GetSource())
{
@@ -585,7 +585,7 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons)
LfgRolesMap rolesMap;
rolesMap[guid] = roles;
LFGQueue& queue = GetQueue(guid);
- queue.AddQueueData(guid, time(NULL), dungeons, rolesMap);
+ queue.AddQueueData(guid, time(nullptr), dungeons, rolesMap);
if (!isContinue)
{
@@ -770,7 +770,7 @@ void LFGMgr::UpdateRoleCheck(ObjectGuid gguid, ObjectGuid guid /* = ObjectGuid::
{
SetState(gguid, LFG_STATE_QUEUED);
LFGQueue& queue = GetQueue(gguid);
- queue.AddQueueData(gguid, time_t(time(NULL)), roleCheck.dungeons, roleCheck.roles);
+ queue.AddQueueData(gguid, time_t(time(nullptr)), roleCheck.dungeons, roleCheck.roles);
RoleChecksStore.erase(itRoleCheck);
}
else if (roleCheck.state != LFG_ROLECHECK_INITIALITING)
@@ -937,7 +937,7 @@ void LFGMgr::MakeNewGroup(LfgProposal const& proposal)
LFGDungeonData const* dungeon = GetLFGDungeon(proposal.dungeonId);
ASSERT(dungeon);
- Group* grp = !proposal.group.IsEmpty() ? sGroupMgr->GetGroupByGUID(proposal.group) : NULL;
+ Group* grp = !proposal.group.IsEmpty() ? sGroupMgr->GetGroupByGUID(proposal.group) : nullptr;
for (GuidList::const_iterator it = players.begin(); it != players.end(); ++it)
{
ObjectGuid pguid = (*it);
@@ -1039,7 +1039,7 @@ void LFGMgr::UpdateProposal(uint32 proposalId, ObjectGuid guid, bool accept)
bool sendUpdate = proposal.state != LFG_PROPOSAL_SUCCESS;
proposal.state = LFG_PROPOSAL_SUCCESS;
- time_t joinTime = time(NULL);
+ time_t joinTime = time(nullptr);
LFGQueue& queue = GetQueue(guid);
LfgUpdateData updateData = LfgUpdateData(LFG_UPDATETYPE_GROUP_FOUND);
@@ -1208,7 +1208,7 @@ void LFGMgr::InitBoot(ObjectGuid gguid, ObjectGuid kicker, ObjectGuid victim, st
LfgPlayerBoot& boot = BootsStore[gguid];
boot.inProgress = true;
- boot.cancelTime = time_t(time(NULL)) + LFG_TIME_BOOT;
+ boot.cancelTime = time_t(time(nullptr)) + LFG_TIME_BOOT;
boot.reason = reason;
boot.victim = victim;
@@ -1296,7 +1296,7 @@ void LFGMgr::UpdateBoot(ObjectGuid guid, bool accept)
*/
void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*/)
{
- LFGDungeonData const* dungeon = NULL;
+ LFGDungeonData const* dungeon = nullptr;
Group* group = player->GetGroup();
if (group && group->isLFGGroup())
@@ -1345,7 +1345,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false*
if (!fromOpcode)
{
// Select a player inside to be teleported to
- for (GroupReference* itr = group->GetFirstMember(); itr != NULL && !mapid; itr = itr->next())
+ for (GroupReference* itr = group->GetFirstMember(); itr != nullptr && !mapid; itr = itr->next())
{
Player* plrg = itr->GetSource();
if (plrg && plrg != player && plrg->GetMapId() == uint32(dungeon->map))
@@ -1463,7 +1463,7 @@ void LFGMgr::FinishDungeon(ObjectGuid gguid, const uint32 dungeonId, Map const*
// if we can take the quest, means that we haven't done this kind of "run", IE: First Heroic Random of Day.
if (player->CanRewardQuest(quest, false))
- player->RewardQuest(quest, 0, NULL, false);
+ player->RewardQuest(quest, 0, nullptr, false);
else
{
done = true;
@@ -1471,7 +1471,7 @@ void LFGMgr::FinishDungeon(ObjectGuid gguid, const uint32 dungeonId, Map const*
if (!quest)
continue;
// we give reward without informing client (retail does this)
- player->RewardQuest(quest, 0, NULL, false);
+ player->RewardQuest(quest, 0, nullptr, false);
}
// Give rewards
@@ -1507,7 +1507,7 @@ LfgDungeonSet const& LFGMgr::GetDungeonsByRandom(uint32 randomdungeon)
*/
LfgReward const* LFGMgr::GetRandomDungeonReward(uint32 dungeon, uint8 level)
{
- LfgReward const* rew = NULL;
+ LfgReward const* rew = nullptr;
LfgRewardContainerBounds bounds = RewardMapStore.equal_range(dungeon & 0x00FFFFFF);
for (LfgRewardContainer::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
{