aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Groups/Group.cpp
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2014-10-16 22:47:02 +0200
committerjackpoz <giacomopoz@gmail.com>2014-10-17 22:35:28 +0200
commitee5eaab598e445e3926edf6e12b1b2b4477c2594 (patch)
tree4a108f6c1d0bf904d19adba49a0a04496c1c4294 /src/server/game/Groups/Group.cpp
parentc5ef82cc4834811c6361f81b37d635cc20712f7a (diff)
Core/Players: Fix players not being notified if on loading screen
Fix packets not being sent to players on loading screen even if the system supports these packets to be queued and sent till the player is in world. There might be additional cases where this applies, please report back if you find any. Fixes #11339
Diffstat (limited to 'src/server/game/Groups/Group.cpp')
-rw-r--r--src/server/game/Groups/Group.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index b203ccb8bb9..9854feaffba 100644
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -495,7 +495,7 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R
// remove member and change leader (if need) only if strong more 2 members _before_ member remove (BG/BF allow 1 member group)
if (GetMembersCount() > ((isBGGroup() || isLFGGroup() || isBFGroup()) ? 1u : 2u))
{
- Player* player = ObjectAccessor::FindPlayer(guid);
+ Player* player = ObjectAccessor::FindConnectedPlayer(guid);
if (player)
{
// Battleground group handling
@@ -579,7 +579,7 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R
{
for (member_witerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
{
- if (ObjectAccessor::FindPlayer(itr->guid))
+ if (ObjectAccessor::FindConnectedPlayer(itr->guid))
{
ChangeLeader(itr->guid);
break;
@@ -591,7 +591,7 @@ bool Group::RemoveMember(ObjectGuid guid, const RemoveMethod& method /*= GROUP_R
if (isLFGGroup() && GetMembersCount() == 1)
{
- Player* leader = ObjectAccessor::FindPlayer(GetLeaderGUID());
+ Player* leader = ObjectAccessor::FindConnectedPlayer(GetLeaderGUID());
uint32 mapId = sLFGMgr->GetDungeonMapId(GetGUID());
if (!mapId || !leader || (leader->IsAlive() && leader->GetMapId() != mapId))
{
@@ -620,7 +620,7 @@ void Group::ChangeLeader(ObjectGuid newLeaderGuid)
if (slot == m_memberSlots.end())
return;
- Player* newLeader = ObjectAccessor::FindPlayer(slot->guid);
+ Player* newLeader = ObjectAccessor::FindConnectedPlayer(slot->guid);
// Don't allow switching leader to offline players
if (!newLeader)
@@ -668,7 +668,7 @@ void Group::ChangeLeader(ObjectGuid newLeaderGuid)
CharacterDatabase.CommitTransaction(trans);
}
- if (Player* oldLeader = ObjectAccessor::FindPlayer(m_leaderGuid))
+ if (Player* oldLeader = ObjectAccessor::FindConnectedPlayer(m_leaderGuid))
oldLeader->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
newLeader->SetFlag(PLAYER_FLAGS, PLAYER_FLAGS_GROUP_LEADER);
@@ -688,7 +688,7 @@ void Group::Disband(bool hideDestroy /* = false */)
Player* player;
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
- player = ObjectAccessor::FindPlayer(citr->guid);
+ player = ObjectAccessor::FindConnectedPlayer(citr->guid);
if (!player)
continue;
@@ -786,7 +786,7 @@ void Group::SendLootStartRoll(uint32 countDown, uint32 mapid, const Roll &r)
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
{
- Player* p = ObjectAccessor::FindPlayer(itr->first);
+ Player* p = ObjectAccessor::FindConnectedPlayer(itr->first);
if (!p || !p->GetSession())
continue;
@@ -832,7 +832,7 @@ void Group::SendLootRoll(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8 rol
for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr)
{
- Player* p = ObjectAccessor::FindPlayer(itr->first);
+ Player* p = ObjectAccessor::FindConnectedPlayer(itr->first);
if (!p || !p->GetSession())
continue;
@@ -855,7 +855,7 @@ void Group::SendLootRollWon(ObjectGuid sourceGuid, ObjectGuid targetGuid, uint8
for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr)
{
- Player* p = ObjectAccessor::FindPlayer(itr->first);
+ Player* p = ObjectAccessor::FindConnectedPlayer(itr->first);
if (!p || !p->GetSession())
continue;
@@ -875,7 +875,7 @@ void Group::SendLootAllPassed(Roll const& roll)
for (Roll::PlayerVote::const_iterator itr = roll.playerVote.begin(); itr != roll.playerVote.end(); ++itr)
{
- Player* player = ObjectAccessor::FindPlayer(itr->first);
+ Player* player = ObjectAccessor::FindConnectedPlayer(itr->first);
if (!player || !player->GetSession())
continue;
@@ -967,7 +967,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
{
for (Roll::PlayerVote::const_iterator itr=r->playerVote.begin(); itr != r->playerVote.end(); ++itr)
{
- Player* p = ObjectAccessor::FindPlayer(itr->first);
+ Player* p = ObjectAccessor::FindConnectedPlayer(itr->first);
if (!p || !p->GetSession())
continue;
@@ -1110,7 +1110,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
//Broadcast Pass and Send Rollstart
for (Roll::PlayerVote::const_iterator itr = r->playerVote.begin(); itr != r->playerVote.end(); ++itr)
{
- Player* p = ObjectAccessor::FindPlayer(itr->first);
+ Player* p = ObjectAccessor::FindConnectedPlayer(itr->first);
if (!p || !p->GetSession())
continue;
@@ -1173,7 +1173,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject)
//Broadcast Pass and Send Rollstart
for (Roll::PlayerVote::const_iterator itr = r->playerVote.begin(); itr != r->playerVote.end(); ++itr)
{
- Player* p = ObjectAccessor::FindPlayer(itr->first);
+ Player* p = ObjectAccessor::FindConnectedPlayer(itr->first);
if (!p || !p->GetSession())
continue;
@@ -1340,7 +1340,7 @@ void Group::CountTheRoll(Rolls::iterator rollI)
}
}
SendLootRollWon(ObjectGuid::Empty, maxguid, maxresul, ROLL_NEED, *roll);
- player = ObjectAccessor::FindPlayer(maxguid);
+ player = ObjectAccessor::FindConnectedPlayer(maxguid);
if (player && player->GetSession())
{
@@ -1389,7 +1389,7 @@ void Group::CountTheRoll(Rolls::iterator rollI)
}
}
SendLootRollWon(ObjectGuid::Empty, maxguid, maxresul, rollvote, *roll);
- player = ObjectAccessor::FindPlayer(maxguid);
+ player = ObjectAccessor::FindConnectedPlayer(maxguid);
if (player && player->GetSession())
{
@@ -1506,7 +1506,7 @@ void Group::SendUpdate()
void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot)
{
- Player* player = ObjectAccessor::FindPlayer(playerGUID);
+ Player* player = ObjectAccessor::FindConnectedPlayer(playerGUID);
if (!player || !player->GetSession() || player->GetGroup() != this)
return;
@@ -1541,7 +1541,7 @@ void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot)
if (slot->guid == citr->guid)
continue;
- Player* member = ObjectAccessor::FindPlayer(citr->guid);
+ Player* member = ObjectAccessor::FindConnectedPlayer(citr->guid);
uint8 onlineState = (member && !member->GetSession()->PlayerLogout()) ? MEMBER_STATUS_ONLINE : MEMBER_STATUS_OFFLINE;
onlineState = onlineState | ((isBGGroup() || isBFGroup()) ? MEMBER_STATUS_PVP : 0);
@@ -1619,7 +1619,7 @@ void Group::OfflineReadyCheck()
{
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
- Player* player = ObjectAccessor::FindPlayer(citr->guid);
+ Player* player = ObjectAccessor::FindConnectedPlayer(citr->guid);
if (!player || !player->GetSession())
{
WorldPacket data(MSG_RAID_READY_CHECK_CONFIRM, 9);
@@ -1702,7 +1702,7 @@ void Group::ChangeMembersGroup(ObjectGuid guid, uint8 group)
}
// In case the moved player is online, update the player object with the new sub group references
- if (Player* player = ObjectAccessor::FindPlayer(guid))
+ if (Player* player = ObjectAccessor::FindConnectedPlayer(guid))
{
if (player->GetGroup() == this)
player->GetGroupRef().setSubGroup(group);
@@ -2127,7 +2127,7 @@ void Group::BroadcastGroupUpdate(void)
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
{
Player* pp = ObjectAccessor::FindPlayer(citr->guid);
- if (pp && pp->IsInWorld())
+ if (pp)
{
pp->ForceValuesUpdateAtIndex(UNIT_FIELD_BYTES_2);
pp->ForceValuesUpdateAtIndex(UNIT_FIELD_FACTIONTEMPLATE);