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
This commit is contained in:
jackpoz committed 2014-10-17 22:35:28 +02:00
1 parent c5ef82cc48
commit ee5eaab598
33 files changed
+119 -120

No files matched your search

+4 -4
View File
@@ -2150,7 +2150,7 @@ void Guild::BroadcastToGuild(WorldSession* session, bool officerOnly, std::strin
WorldPacket data;
ChatHandler::BuildChatPacket(data, officerOnly ? CHAT_MSG_OFFICER : CHAT_MSG_GUILD, Language(language), session->GetPlayer(), NULL, msg);
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (Player* player = itr->second->FindPlayer())
if (Player* player = itr->second->FindConnectedPlayer())
if (player->GetSession() && _HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) &&
!player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUIDLow()))
player->GetSession()->SendPacket(&data);
@@ -2161,7 +2161,7 @@ void Guild::BroadcastPacketToRank(WorldPacket* packet, uint8 rankId) const
{
for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
if (itr->second->IsRank(rankId))
if (Player* player = itr->second->FindPlayer())
if (Player* player = itr->second->FindConnectedPlayer())
player->GetSession()->SendPacket(packet);
}
@@ -2208,7 +2208,7 @@ void Guild::MassInviteToEvent(WorldSession* session, uint32 minLevel, uint32 max
// Members handling
bool Guild::AddMember(ObjectGuid guid, uint8 rankId)
{
Player* player = ObjectAccessor::FindPlayer(guid);
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
// Player cannot be in guild
if (player)
{
@@ -2285,7 +2285,7 @@ bool Guild::AddMember(ObjectGuid guid, uint8 rankId)
void Guild::DeleteMember(ObjectGuid guid, bool isDisbanding, bool isKicked, bool canDeleteGuild)
{
uint32 lowguid = guid.GetCounter();
Player* player = ObjectAccessor::FindPlayer(guid);
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
// Guild master can be deleted when loading guild and guid doesn't exist in characters table
// or when he is removed from guild by gm command