aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Groups/Group.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/Groups/Group.cpp
parent02fd3a1f15840203d8515dae12920d9b66655076 (diff)
Core/Misc: Replace NULL with nullptr
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rw-r--r--src/server/game/Groups/Group.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index bf6a23692fe..10d09b63c11 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -80,9 +80,9 @@ Group::~Group()
{
TC_LOG_DEBUG("bg.battleground", "Group::~Group: battleground group being deleted.");
if (m_bgGroup->GetBgRaid(ALLIANCE) == this)
- m_bgGroup->SetBgRaid(ALLIANCE, NULL);
+ m_bgGroup->SetBgRaid(ALLIANCE, nullptr);
else if (m_bgGroup->GetBgRaid(HORDE) == this)
- m_bgGroup->SetBgRaid(HORDE, NULL);
+ m_bgGroup->SetBgRaid(HORDE, nullptr);
else
TC_LOG_ERROR("misc", "Group::~Group: battleground group is not linked to the correct battleground.");
}
@@ -288,7 +288,7 @@ void Group::ConvertToGroup()
if (m_subGroupsCounts)
{
delete[] m_subGroupsCounts;
- m_subGroupsCounts = NULL;
+ m_subGroupsCounts = nullptr;
}
if (!isBGGroup() && !isBFGroup())
@@ -345,7 +345,7 @@ void Group::RemoveInvite(Player* player)
if (player)
{
m_invitees.erase(player);
- player->SetGroupInvite(NULL);
+ player->SetGroupInvite(nullptr);
}
}
@@ -353,7 +353,7 @@ void Group::RemoveAllInvites()
{
for (InvitesList::iterator itr=m_invitees.begin(); itr != m_invitees.end(); ++itr)
if (*itr)
- (*itr)->SetGroupInvite(NULL);
+ (*itr)->SetGroupInvite(nullptr);
m_invitees.clear();
}
@@ -365,7 +365,7 @@ Player* Group::GetInvited(ObjectGuid guid) const
if ((*itr) && (*itr)->GetGUID() == guid)
return (*itr);
}
- return NULL;
+ return nullptr;
}
Player* Group::GetInvited(const std::string& name) const
@@ -375,7 +375,7 @@ Player* Group::GetInvited(const std::string& name) const
if ((*itr) && (*itr)->GetName() == name)
return (*itr);
}
- return NULL;
+ return nullptr;
}
bool Group::AddMember(Player* player)
@@ -410,7 +410,7 @@ bool Group::AddMember(Player* player)
SubGroupCounterIncrease(subGroup);
- player->SetGroupInvite(NULL);
+ player->SetGroupInvite(nullptr);
if (player->GetGroup())
{
if (isBGGroup() || isBFGroup()) // if player is in group and he is being added to BG raid group, then call SetBattlegroundRaid()
@@ -491,7 +491,7 @@ bool Group::AddMember(Player* player)
WorldPacket groupDataPacket;
// Broadcast group members' fields to player
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
if (itr->GetSource() == player)
continue;
@@ -528,7 +528,7 @@ bool Group::AddMember(Player* player)
return true;
}
-bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /*= 0*/, const char* reason /*= NULL*/)
+bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /*= 0*/, const char* reason /*= nullptr*/)
{
BroadcastGroupUpdate();
@@ -566,9 +566,9 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R
// Regular group
{
if (player->GetOriginalGroup() == this)
- player->SetOriginalGroup(NULL);
+ player->SetOriginalGroup(nullptr);
else
- player->SetGroup(NULL);
+ player->SetGroup(nullptr);
// quest related GO state dependent from raid membership
player->UpdateForQuestWorldObjects();
@@ -799,9 +799,9 @@ void Group::Disband(bool hideDestroy /* = false */)
{
//we can remove player who is in battleground from his original group
if (player->GetOriginalGroup() == this)
- player->SetOriginalGroup(NULL);
+ player->SetOriginalGroup(nullptr);
else
- player->SetGroup(NULL);
+ player->SetGroup(nullptr);
}
player->SetPartyType(m_groupCategory, GROUP_TYPE_NONE);
@@ -836,9 +836,9 @@ void Group::Disband(bool hideDestroy /* = false */)
CharacterDatabase.CommitTransaction(trans);
- ResetInstances(INSTANCE_RESET_GROUP_DISBAND, false, false, NULL);
- ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, false, NULL);
- ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, true, NULL);
+ ResetInstances(INSTANCE_RESET_GROUP_DISBAND, false, false, nullptr);
+ ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, false, nullptr);
+ ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, true, nullptr);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA);
stmt->setUInt32(0, m_dbStoreId);
@@ -987,7 +987,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* lootedObject)
{
Roll* r = new Roll(*i);
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* playerToRoll = itr->GetSource();
if (!playerToRoll || !playerToRoll->GetSession())
@@ -1058,7 +1058,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* lootedObject)
item = sObjectMgr->GetItemTemplate(i->itemid);
Roll* r = new Roll(*i);
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* playerToRoll = itr->GetSource();
if (!playerToRoll || !playerToRoll->GetSession())
@@ -1133,7 +1133,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject)
WorldPackets::Loot::MasterLootCandidateList masterLootCandidateList;
masterLootCandidateList.LootObj = loot->GetGUID();
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* looter = itr->GetSource();
if (!looter->IsInWorld())
@@ -1145,7 +1145,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject)
masterLootCandidateList.Write();
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* looter = itr->GetSource();
if (looter->IsAtGroupRewardDistance(pLootedObject))
@@ -1300,7 +1300,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
continue;
player = ObjectAccessor::FindPlayer(itr->first);
- if (!player || (allowedMap != NULL && player->FindMap() != allowedMap))
+ if (!player || (allowedMap != nullptr && player->FindMap() != allowedMap))
{
--roll->totalGreed;
continue;
@@ -1551,7 +1551,7 @@ void Group::UpdatePlayerOutOfRange(Player* player)
packet.Initialize(player);
Player* member;
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
member = itr->GetSource();
if (member && member != player && (!member->IsInMap(player) || !member->IsWithinDist(player, member->GetSightRange(), false)))
@@ -1561,7 +1561,7 @@ void Group::UpdatePlayerOutOfRange(Player* player)
void Group::BroadcastAddonMessagePacket(WorldPacket const* packet, const std::string& prefix, bool ignorePlayersInBGRaid, int group /*= -1*/, ObjectGuid ignore /*= ObjectGuid::Empty*/)
{
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* player = itr->GetSource();
if (!player || (!ignore.IsEmpty() && player->GetGUID() == ignore) || (ignorePlayersInBGRaid && player->GetGroup() != this))
@@ -1576,7 +1576,7 @@ void Group::BroadcastAddonMessagePacket(WorldPacket const* packet, const std::st
void Group::BroadcastPacket(WorldPacket const* packet, bool ignorePlayersInBGRaid, int group, ObjectGuid ignoredPlayer)
{
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* player = itr->GetSource();
if (!player || (!ignoredPlayer.IsEmpty() && player->GetGUID() == ignoredPlayer) || (ignorePlayersInBGRaid && player->GetGroup() != this))
@@ -1752,7 +1752,7 @@ void Group::UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed)
}
// search next after current
- Player* pNewLooter = NULL;
+ Player* pNewLooter = nullptr;
for (member_citerator itr = guid_itr; itr != m_memberSlots.end(); ++itr)
{
if (Player* player = ObjectAccessor::FindPlayer(itr->guid))
@@ -1823,7 +1823,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
// check every member of the group to be able to join
memberscount = 0;
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next(), ++memberscount)
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next(), ++memberscount)
{
Player* member = itr->GetSource();
// offline member? don't let join
@@ -1929,7 +1929,7 @@ void Group::SetDungeonDifficultyID(Difficulty difficulty)
CharacterDatabase.Execute(stmt);
}
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* player = itr->GetSource();
if (!player->GetSession())
@@ -1953,7 +1953,7 @@ void Group::SetRaidDifficultyID(Difficulty difficulty)
CharacterDatabase.Execute(stmt);
}
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* player = itr->GetSource();
if (!player->GetSession())
@@ -1977,7 +1977,7 @@ void Group::SetLegacyRaidDifficultyID(Difficulty difficulty)
CharacterDatabase.Execute(stmt);
}
- for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
+ for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
{
Player* player = itr->GetSource();
if (!player->GetSession())
@@ -2064,7 +2064,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, bool isLegacy, Player* Sen
{
if (Group* group = SendMsgTo->GetGroup())
{
- for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next())
+ for (GroupReference* groupRef = group->GetFirstMember(); groupRef != nullptr; groupRef = groupRef->next())
if (Player* player = groupRef->GetSource())
player->SendResetInstanceSuccess(instanceSave->GetMapId());
}
@@ -2116,7 +2116,7 @@ InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry)
{
if (!mapEntry || !mapEntry->IsDungeon())
- return NULL;
+ return nullptr;
Difficulty difficulty = GetDifficultyID(mapEntry);
return GetBoundInstance(difficulty, mapEntry->ID);
@@ -2141,7 +2141,7 @@ InstanceGroupBind* Group::GetBoundInstance(Difficulty difficulty, uint32 mapId)
InstanceGroupBind* Group::BindToInstance(InstanceSave* save, bool permanent, bool load)
{
if (!save || isBGGroup() || isBFGroup())
- return NULL;
+ return nullptr;
InstanceGroupBind& bind = m_boundInstances[save->GetDifficultyID()][save->GetMapId()];
if (!load && (!bind.save || permanent != bind.perm || save != bind.save))
@@ -2219,7 +2219,7 @@ void Group::BroadcastGroupUpdate(void)
void Group::ResetMaxEnchantingLevel()
{
m_maxEnchantingLevel = 0;
- Player* member = NULL;
+ Player* member = nullptr;
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
member = ObjectAccessor::FindPlayer(citr->guid);
@@ -2433,12 +2433,12 @@ bool Group::isRaidGroup() const
bool Group::isBGGroup() const
{
- return m_bgGroup != NULL;
+ return m_bgGroup != nullptr;
}
bool Group::isBFGroup() const
{
- return m_bfGroup != NULL;
+ return m_bfGroup != nullptr;
}
bool Group::IsCreated() const