Core: header cleanup, split realmlist, boost compatibility, cotire, remove stormlib/zlib and stormlib/bzip2 and instead use dep sources
This commit is contained in:
1 parent
7fff6c424f
commit
5ff847159c
1243 files changed
+29780
-36517
No files matched your search
@@ -16,26 +16,32 @@
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "CharacterCache.h"
|
||||
#include "Common.h"
|
||||
#include "Opcodes.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
#include "Player.h"
|
||||
#include "World.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "Group.h"
|
||||
#include "Formulas.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "Battleground.h"
|
||||
#include "BattlegroundMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "CharacterCache.h"
|
||||
#include "Common.h"
|
||||
#include "DatabaseEnv.h"
|
||||
#include "DynamicObject.h"
|
||||
#include "Formulas.h"
|
||||
#include "GameObject.h"
|
||||
#include "GroupMgr.h"
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "Util.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "UpdateFieldFlags.h"
|
||||
#include "LootMgr.h"
|
||||
#include "MapManager.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Opcodes.h"
|
||||
#include "Player.h"
|
||||
#include "Random.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "UpdateData.h"
|
||||
#include "UpdateFieldFlags.h"
|
||||
#include "Util.h"
|
||||
#include "World.h"
|
||||
#include "WorldPacket.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
Roll::Roll(ObjectGuid _guid, LootItem const& li) : itemGUID(_guid), itemid(li.itemid),
|
||||
itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix), itemCount(li.count),
|
||||
@@ -56,8 +62,8 @@ Loot* Roll::getLoot()
|
||||
|
||||
Group::Group() : m_leaderGuid(), m_leaderName(""), m_groupType(GROUPTYPE_NORMAL),
|
||||
m_dungeonDifficulty(DUNGEON_DIFFICULTY_NORMAL), m_raidDifficulty(RAID_DIFFICULTY_10MAN_NORMAL),
|
||||
m_bgGroup(NULL), m_bfGroup(NULL), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(),
|
||||
m_masterLooterGuid(), m_subGroupsCounts(NULL), m_guid(), m_counter(0), m_maxEnchantingLevel(0), m_dbStoreId(0)
|
||||
m_bgGroup(nullptr), m_bfGroup(nullptr), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(),
|
||||
m_masterLooterGuid(), m_subGroupsCounts(nullptr), m_guid(), m_counter(0), m_maxEnchantingLevel(0), m_dbStoreId(0)
|
||||
{
|
||||
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
|
||||
m_targetIcons[i].Clear();
|
||||
@@ -68,8 +74,8 @@ Group::~Group()
|
||||
if (m_bgGroup)
|
||||
{
|
||||
TC_LOG_DEBUG("bg.battleground", "Group::~Group: battleground group being deleted.");
|
||||
if (m_bgGroup->GetBgRaid(ALLIANCE) == this) m_bgGroup->SetBgRaid(ALLIANCE, NULL);
|
||||
else if (m_bgGroup->GetBgRaid(HORDE) == this) m_bgGroup->SetBgRaid(HORDE, NULL);
|
||||
if (m_bgGroup->GetBgRaid(ALLIANCE) == this) m_bgGroup->SetBgRaid(ALLIANCE, nullptr);
|
||||
else if (m_bgGroup->GetBgRaid(HORDE) == this) m_bgGroup->SetBgRaid(HORDE, nullptr);
|
||||
else TC_LOG_ERROR("misc", "Group::~Group: battleground group is not linked to the correct battleground.");
|
||||
}
|
||||
Rolls::iterator itr;
|
||||
@@ -276,7 +282,7 @@ void Group::ConvertToGroup()
|
||||
if (m_subGroupsCounts)
|
||||
{
|
||||
delete[] m_subGroupsCounts;
|
||||
m_subGroupsCounts = NULL;
|
||||
m_subGroupsCounts = nullptr;
|
||||
}
|
||||
|
||||
if (!isBGGroup() && !isBFGroup())
|
||||
@@ -333,7 +339,7 @@ void Group::RemoveInvite(Player* player)
|
||||
if (player)
|
||||
{
|
||||
m_invitees.erase(player);
|
||||
player->SetGroupInvite(NULL);
|
||||
player->SetGroupInvite(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -341,7 +347,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();
|
||||
}
|
||||
@@ -353,7 +359,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
|
||||
@@ -363,7 +369,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)
|
||||
@@ -396,7 +402,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()
|
||||
@@ -470,7 +476,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;
|
||||
@@ -513,7 +519,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*/, char const* reason /*= nullptr*/)
|
||||
{
|
||||
BroadcastGroupUpdate();
|
||||
|
||||
@@ -551,9 +557,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();
|
||||
@@ -564,14 +570,14 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R
|
||||
if (method == GROUP_REMOVEMETHOD_KICK || method == GROUP_REMOVEMETHOD_KICK_LFG)
|
||||
{
|
||||
data.Initialize(SMSG_GROUP_UNINVITE, 0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
// Do we really need to send this opcode?
|
||||
data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8);
|
||||
data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0);
|
||||
data << uint64(m_guid) << uint32(m_counter) << uint32(0) << uint64(0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
|
||||
_homebindIfInstance(player);
|
||||
}
|
||||
@@ -785,9 +791,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);
|
||||
}
|
||||
|
||||
// quest related GO state dependent from raid membership
|
||||
@@ -801,7 +807,7 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
if (!hideDestroy)
|
||||
{
|
||||
data.Initialize(SMSG_GROUP_DESTROYED, 0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
//we already removed player from group and in player->GetGroup() is his original group, send update
|
||||
@@ -814,7 +820,7 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8);
|
||||
data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0);
|
||||
data << uint64(m_guid) << uint32(m_counter) << uint32(0) << uint64(0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
_homebindIfInstance(player);
|
||||
@@ -845,8 +851,8 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
ResetInstances(INSTANCE_RESET_GROUP_DISBAND, false, NULL);
|
||||
ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, NULL);
|
||||
ResetInstances(INSTANCE_RESET_GROUP_DISBAND, false, nullptr);
|
||||
ResetInstances(INSTANCE_RESET_GROUP_DISBAND, true, nullptr);
|
||||
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_LFG_DATA);
|
||||
stmt->setUInt32(0, m_dbStoreId);
|
||||
@@ -863,7 +869,7 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
/*** LOOT SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
void Group::SendLootStartRoll(uint32 countDown, uint32 mapid, const Roll &r)
|
||||
void Group::SendLootStartRoll(uint32 countDown, uint32 mapid, Roll const& r)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4+1));
|
||||
data << uint64(r.itemGUID); // guid of rolled item
|
||||
@@ -884,7 +890,7 @@ void Group::SendLootStartRoll(uint32 countDown, uint32 mapid, const Roll &r)
|
||||
continue;
|
||||
|
||||
if (itr->second == NOT_EMITED_YET)
|
||||
p->GetSession()->SendPacket(&data);
|
||||
p->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -908,7 +914,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p,
|
||||
data << uint8(voteMask); // roll type mask
|
||||
data << uint8(r.totalPlayersRolling); // maybe the number of players rolling for it???
|
||||
|
||||
p->GetSession()->SendPacket(&data);
|
||||
p->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll)
|
||||
@@ -931,7 +937,7 @@ void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rol
|
||||
continue;
|
||||
|
||||
if (itr->second != NOT_VALID)
|
||||
p->GetSession()->SendPacket(&data);
|
||||
p->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -954,7 +960,7 @@ void Group::SendLootRollWon(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8
|
||||
continue;
|
||||
|
||||
if (itr->second != NOT_VALID)
|
||||
p->GetSession()->SendPacket(&data);
|
||||
p->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -974,7 +980,7 @@ void Group::SendLootAllPassed(Roll const& roll)
|
||||
continue;
|
||||
|
||||
if (itr->second != NOT_VALID)
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1025,7 +1031,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
|
||||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
//a vector is filled with only near party members
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->GetSource();
|
||||
if (!member || !member->GetSession())
|
||||
@@ -1107,7 +1113,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
|
||||
Roll* r = new Roll(newitemGUID, *i);
|
||||
|
||||
//a vector is filled with only near party members
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->GetSource();
|
||||
if (!member || !member->GetSession())
|
||||
@@ -1165,7 +1171,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
|
||||
|
||||
Roll* r = new Roll(newitemGUID, *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())
|
||||
@@ -1240,7 +1246,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
|
||||
|
||||
Roll* r = new Roll(newitemGUID, *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())
|
||||
@@ -1316,7 +1322,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject)
|
||||
WorldPacket data(SMSG_LOOT_MASTER_LIST, 1 + GetMembersCount() * 8);
|
||||
data << uint8(GetMembersCount());
|
||||
|
||||
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())
|
||||
@@ -1331,11 +1337,11 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject)
|
||||
|
||||
data.put<uint8>(0, real_count);
|
||||
|
||||
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))
|
||||
looter->GetSession()->SendPacket(&data);
|
||||
looter->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1460,7 +1466,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
||||
{
|
||||
item->is_blocked = false;
|
||||
item->rollWinnerGUID = player->GetGUID();
|
||||
player->SendEquipError(msg, NULL, NULL, roll->itemid);
|
||||
player->SendEquipError(msg, nullptr, nullptr, roll->itemid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1485,7 +1491,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;
|
||||
@@ -1527,7 +1533,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
||||
{
|
||||
item->is_blocked = false;
|
||||
item->rollWinnerGUID = player->GetGUID();
|
||||
player->SendEquipError(msg, NULL, NULL, roll->itemid);
|
||||
player->SendEquipError(msg, nullptr, nullptr, roll->itemid);
|
||||
}
|
||||
}
|
||||
else if (rollvote == DISENCHANT)
|
||||
@@ -1552,7 +1558,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
||||
for (uint32 i = 0; i < max_slot; ++i)
|
||||
{
|
||||
LootItem* lootItem = loot.LootItemInSlot(i, player);
|
||||
player->SendEquipError(msg, NULL, NULL, lootItem->itemid);
|
||||
player->SendEquipError(msg, nullptr, nullptr, lootItem->itemid);
|
||||
player->SendItemRetrievalMail(lootItem->itemid, lootItem->count);
|
||||
}
|
||||
}
|
||||
@@ -1629,7 +1635,7 @@ void Group::SendRaidMarkerUpdate()
|
||||
if (!player || !player->GetSession())
|
||||
continue;
|
||||
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1641,7 +1647,7 @@ void Group::SendRaidMarkerUpdateToPlayer(ObjectGuid playerGUID, bool remove)
|
||||
|
||||
WorldPacket data(SMSG_RAID_MARKERS_CHANGED, 4);
|
||||
data << uint32(remove ? 0 : m_markerMask);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
DynamicObject* Group::GetMarkerGuidBySpell(uint32 spell)
|
||||
@@ -1656,7 +1662,7 @@ DynamicObject* Group::GetMarkerGuidBySpell(uint32 spell)
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void Group::RemoveMarker()
|
||||
@@ -1751,7 +1757,7 @@ void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot)
|
||||
data << uint8(m_raidDifficulty); // Raid Difficulty
|
||||
}
|
||||
|
||||
player->GetSession()->SendPacket(&data);
|
||||
player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
void Group::UpdatePlayerOutOfRange(Player* player)
|
||||
@@ -1763,17 +1769,17 @@ void Group::UpdatePlayerOutOfRange(Player* player)
|
||||
player->GetSession()->BuildPartyMemberStatsChangedPacket(player, &data);
|
||||
|
||||
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)))
|
||||
member->GetSession()->SendPacket(&data);
|
||||
member->SendDirectMessage(&data);
|
||||
}
|
||||
}
|
||||
|
||||
void Group::BroadcastAddonMessagePacket(WorldPacket* packet, const std::string& prefix, bool ignorePlayersInBGRaid, int group, uint64 ignore)
|
||||
{
|
||||
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 != 0 && player->GetGUID() == ignore) || (ignorePlayersInBGRaid && player->GetGroup() != this))
|
||||
@@ -1788,25 +1794,25 @@ void Group::BroadcastAddonMessagePacket(WorldPacket* packet, const std::string&
|
||||
|
||||
void Group::BroadcastPacket(WorldPacket* 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))
|
||||
continue;
|
||||
|
||||
if (player->GetSession() && (group == -1 || itr->getSubGroup() == group))
|
||||
player->GetSession()->SendPacket(packet);
|
||||
player->SendDirectMessage(packet);
|
||||
}
|
||||
}
|
||||
|
||||
void Group::BroadcastReadyCheck(WorldPacket* packet)
|
||||
{
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
if (player && player->GetSession())
|
||||
if (IsLeader(player->GetGUID()) || IsAssistant(player->GetGUID()))
|
||||
player->GetSession()->SendPacket(packet);
|
||||
player->SendDirectMessage(packet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1946,7 +1952,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))
|
||||
@@ -2019,7 +2025,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
|
||||
@@ -2088,7 +2094,7 @@ void Group::SetDungeonDifficulty(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())
|
||||
@@ -2112,7 +2118,7 @@ void Group::SetRaidDifficulty(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())
|
||||
@@ -2125,7 +2131,7 @@ void Group::SetRaidDifficulty(Difficulty difficulty)
|
||||
|
||||
bool Group::InCombatToInstance(uint32 instanceId)
|
||||
{
|
||||
for (GroupReference* itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference* itr = GetFirstMember(); itr != nullptr; itr = itr->next())
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
if (player && player->GetInstanceId() == instanceId && !player->getAttackers().empty() && (player->GetMap()->IsRaidOrHeroicDungeon()))
|
||||
@@ -2185,7 +2191,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, Player* SendMsgTo)
|
||||
{
|
||||
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());
|
||||
}
|
||||
@@ -2241,7 +2247,7 @@ InstanceGroupBind* Group::GetBoundInstance(Map* aMap)
|
||||
InstanceGroupBind* Group::GetBoundInstance(MapEntry const* mapEntry)
|
||||
{
|
||||
if (!mapEntry || !mapEntry->IsDungeon())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Difficulty difficulty = GetDifficulty(mapEntry->IsRaid());
|
||||
return GetBoundInstance(difficulty, mapEntry->MapID);
|
||||
@@ -2256,13 +2262,13 @@ InstanceGroupBind* Group::GetBoundInstance(Difficulty difficulty, uint32 mapId)
|
||||
if (itr != m_boundInstances[difficulty].end())
|
||||
return &itr->second;
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
InstanceGroupBind* Group::BindToInstance(InstanceSave* save, bool permanent, bool load)
|
||||
{
|
||||
if (!save || isBGGroup() || isBFGroup())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
InstanceGroupBind& bind = m_boundInstances[save->GetDifficulty()][save->GetMapId()];
|
||||
if (!load && (!bind.save || permanent != bind.perm || save != bind.save))
|
||||
@@ -2337,7 +2343,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);
|
||||
@@ -2393,12 +2399,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
|
||||
|
||||
Reference in new issue
Block a user