mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7396] Fixed crash at group disband after some player invite decline and offline.
Correctly cleanup invites list at decline.
This commit is contained in:
parent
2159dee379
commit
1727657ab5
3 changed files with 7 additions and 17 deletions
|
|
@ -215,26 +215,16 @@ void WorldSession::HandleGroupDeclineOpcode( WorldPacket & /*recv_data*/ )
|
|||
Group *group = GetPlayer()->GetGroupInvite();
|
||||
if (!group) return;
|
||||
|
||||
// remember leader if online
|
||||
Player *leader = objmgr.GetPlayer(group->GetLeaderGUID());
|
||||
|
||||
/** error handling **/
|
||||
// uninvite, group can be deleted
|
||||
GetPlayer()->UninviteFromGroup();
|
||||
|
||||
if(!leader || !leader->GetSession())
|
||||
return;
|
||||
/********************/
|
||||
|
||||
// everything's fine, do it
|
||||
if(!group->IsCreated())
|
||||
{
|
||||
// note: this means that if you invite more than one person
|
||||
// and one of them declines before the first one accepts
|
||||
// all invites will be cleared
|
||||
// fixme: is that ok ?
|
||||
group->RemoveAllInvites();
|
||||
delete group;
|
||||
}
|
||||
|
||||
GetPlayer()->SetGroupInvite(NULL);
|
||||
|
||||
// report
|
||||
WorldPacket data( SMSG_GROUP_DECLINE, 10 ); // guess size
|
||||
data << GetPlayer()->GetName();
|
||||
leader->GetSession()->SendPacket( &data );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue