diff options
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rw-r--r-- | src/server/game/Groups/Group.cpp | 36 |
1 files changed, 16 insertions, 20 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index 10d09b63c11..22e9b84252e 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -19,7 +19,6 @@ #include "Battleground.h" #include "BattlegroundMgr.h" #include "CharacterCache.h" -#include "Common.h" #include "DatabaseEnv.h" #include "DB2Stores.h" #include "Formulas.h" @@ -38,7 +37,6 @@ #include "Pet.h" #include "Player.h" #include "Random.h" -#include "SpellAuras.h" #include "UpdateData.h" #include "Util.h" #include "World.h" @@ -351,7 +349,7 @@ void Group::RemoveInvite(Player* player) void Group::RemoveAllInvites() { - for (InvitesList::iterator itr=m_invitees.begin(); itr != m_invitees.end(); ++itr) + for (InvitesList::iterator itr = m_invitees.begin(); itr != m_invitees.end(); ++itr) if (*itr) (*itr)->SetGroupInvite(nullptr); @@ -528,7 +526,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 /*= nullptr*/) +bool Group::RemoveMember(ObjectGuid guid, RemoveMethod method /*= GROUP_REMOVEMETHOD_DEFAULT*/, ObjectGuid kicker /*= 0*/, const char* reason /*= nullptr*/) { BroadcastGroupUpdate(); @@ -890,7 +888,7 @@ void Group::SendLootRoll(ObjectGuid playerGuid, int32 rollNumber, uint8 rollType continue; if (itr->second != NOT_VALID) - p->GetSession()->SendPacket(lootRoll.GetRawPacket()); + p->SendDirectMessage(lootRoll.GetRawPacket()); } } @@ -912,7 +910,7 @@ void Group::SendLootRollWon(ObjectGuid winnerGuid, int32 rollNumber, uint8 rollT continue; if (itr->second != NOT_VALID) - p->GetSession()->SendPacket(lootRollWon.GetRawPacket()); + p->SendDirectMessage(lootRollWon.GetRawPacket()); } } @@ -930,7 +928,7 @@ void Group::SendLootAllPassed(Roll const& roll) const continue; if (itr->second != NOT_VALID) - player->GetSession()->SendPacket(lootAllPassed.GetRawPacket()); + player->SendDirectMessage(lootAllPassed.GetRawPacket()); } } @@ -948,7 +946,7 @@ void Group::SendLootRollsComplete(Roll const& roll) const continue; if (itr->second != NOT_VALID) - player->GetSession()->SendPacket(lootRollsComplete.GetRawPacket()); + player->SendDirectMessage(lootRollsComplete.GetRawPacket()); } } @@ -1149,7 +1147,7 @@ void Group::MasterLoot(Loot* loot, WorldObject* pLootedObject) { Player* looter = itr->GetSource(); if (looter->IsAtGroupRewardDistance(pLootedObject)) - looter->GetSession()->SendPacket(masterLootCandidateList.GetRawPacket()); + looter->SendDirectMessage(masterLootCandidateList.GetRawPacket()); } } @@ -1231,7 +1229,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap) ObjectGuid maxguid = ObjectGuid::Empty; Player* player = nullptr; - for (Roll::PlayerVote::const_iterator itr=roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr) + for (Roll::PlayerVote::const_iterator itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr) { if (itr->second != NEED) continue; @@ -1527,7 +1525,7 @@ void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot) partyUpdate.LfgInfos->MyKickVoteCount = 0; } - player->GetSession()->SendPacket(partyUpdate.Write()); + player->SendDirectMessage(partyUpdate.Write()); } void Group::SendUpdateDestroyGroupToPlayer(Player* player) const @@ -1539,7 +1537,7 @@ void Group::SendUpdateDestroyGroupToPlayer(Player* player) const partyUpdate.PartyGUID = m_guid; partyUpdate.MyIndex = -1; partyUpdate.SequenceNum = player->NextGroupUpdateSequenceNumber(m_groupCategory); - player->GetSession()->SendPacket(partyUpdate.Write()); + player->SendDirectMessage(partyUpdate.Write()); } void Group::UpdatePlayerOutOfRange(Player* player) @@ -1555,7 +1553,7 @@ void Group::UpdatePlayerOutOfRange(Player* player) { member = itr->GetSource(); if (member && member != player && (!member->IsInMap(player) || !member->IsWithinDist(player, member->GetSightRange(), false))) - member->GetSession()->SendPacket(packet.Write()); + member->SendDirectMessage(packet.Write()); } } @@ -1567,10 +1565,8 @@ void Group::BroadcastAddonMessagePacket(WorldPacket const* packet, const std::st if (!player || (!ignore.IsEmpty() && player->GetGUID() == ignore) || (ignorePlayersInBGRaid && player->GetGroup() != this)) continue; - if (WorldSession* session = player->GetSession()) - if (session && (group == -1 || itr->getSubGroup() == group)) - if (session->IsAddonRegistered(prefix)) - session->SendPacket(packet); + if (player->GetSession()->IsAddonRegistered(prefix) && (group == -1 || itr->getSubGroup() == group)) + player->SendDirectMessage(packet); } } @@ -1582,8 +1578,8 @@ void Group::BroadcastPacket(WorldPacket const* packet, bool ignorePlayersInBGRai if (!player || (!ignoredPlayer.IsEmpty() && player->GetGUID() == ignoredPlayer) || (ignorePlayersInBGRaid && player->GetGroup() != this)) continue; - if (player->GetSession() && (group == -1 || itr->getSubGroup() == group)) - player->GetSession()->SendPacket(packet); + if (group == -1 || itr->getSubGroup() == group) + player->SendDirectMessage(packet); } } @@ -2028,7 +2024,7 @@ void Group::ResetInstances(uint8 method, bool isRaid, bool isLegacy, Player* Sen for (auto itr = difficultyItr->second.begin(); itr != difficultyItr->second.end();) { InstanceSave* instanceSave = itr->second.save; - const MapEntry* entry = sMapStore.LookupEntry(itr->first); + MapEntry const* entry = sMapStore.LookupEntry(itr->first); if (!entry || entry->IsRaid() != isRaid || (!instanceSave->CanReset() && method != INSTANCE_RESET_GROUP_DISBAND)) { ++itr; |