fix(Core/Social): cleanup + fix crash in friend system (#3832)

fix crash when a friend or ignore get GUID 0 and also double friend list
This commit is contained in:
Viste
2020-12-04 00:20:35 +00:00
committed by GitHub
parent 9befc2c904
commit 755e30f916
5 changed files with 283 additions and 310 deletions

View File

@@ -4940,7 +4940,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
{
if (Player* pFriend = ObjectAccessor::FindPlayerInOrOutOfWorld(MAKE_NEW_GUID((*resultFriends)[0].GetUInt32(), 0, HIGHGUID_PLAYER)))
{
pFriend->GetSocial()->RemoveFromSocialList(guid, false);
pFriend->GetSocial()->RemoveFromSocialList(guid, SOCIAL_FLAG_ALL);
sSocialMgr->SendFriendStatus(pFriend, FRIEND_REMOVED, guid, false);
}
} while (resultFriends->NextRow());
@@ -23268,7 +23268,7 @@ void Player::SetGroup(Group* group, int8 subgroup)
void Player::SendInitialPacketsBeforeAddToMap()
{
/// Pass 'this' as argument because we're not stored in ObjectAccessor yet
GetSocial()->SendSocialList(this);
GetSocial()->SendSocialList(this, SOCIAL_FLAG_ALL);
// guild bank list wtf?