aboutsummaryrefslogtreecommitdiff
path: root/src/game/GroupHandler.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-07 10:42:13 -0600
committermegamage <none@none>2009-03-07 10:42:13 -0600
commitacceab49c63d112ff6c7fa06dbd80566a959955e (patch)
tree09ebb166e5d7594c631417e8ecd766c41ddf82a2 /src/game/GroupHandler.cpp
parente3fa93e75fa5d0f31d686941fd23cf84b6ec49a0 (diff)
[7396] Fixed crash at group disband after some player invite decline and offline. Author: VladimirMangos
Correctly cleanup invites list at decline. --HG-- branch : trunk
Diffstat (limited to 'src/game/GroupHandler.cpp')
-rw-r--r--src/game/GroupHandler.cpp20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/game/GroupHandler.cpp b/src/game/GroupHandler.cpp
index a072b92a0d4..892e8e017a5 100644
--- a/src/game/GroupHandler.cpp
+++ b/src/game/GroupHandler.cpp
@@ -225,26 +225,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 );