void Group::Disband() { m_groupLock.Acquire(); m_updateblock = true; if(m_isqueued) { m_isqueued=false; WorldPacket * data = sChatHandler.FillSystemMessageData("A change was made to your group. Removing the arena queue."); SendPacketToAll(data); delete data; BattlegroundManager.RemoveGroupFromQueues(this); } uint32 i = 0; for(i = 0; i < m_SubGroupCount; i++) { SubGroup *sg = m_SubGroups[i]; sg->Disband(); } m_groupLock.Release(); CharacterDatabase.Execute("DELETE FROM groups WHERE group_id = %u", m_Id); sInstanceMgr.OnGroupDestruction(this); delete this; // destroy ourselves, the destructor removes from eventmgr and objectmgr. }
void Group::Disband() { uint32 i = 0; for(i = 0; i < m_SubGroupCount; i++) { SubGroup *sg = m_SubGroups[i]; sg->Disband(true); } delete this; // destroy ourselves, the destructor removes from eventmgr and objectmgr. }