Group creation again (follow-up to 132538d). Groups now only disband if all members reject the invitation (as opposed to if any member rejects the invitation).

This commit is contained in:
Aokromes committed 2017-06-17 11:41:57 +02:00
1 parent b1f54ba152
commit 4e95a6b4ad
2 files changed
+7 -6

No files matched your search

+6 -6
View File
@@ -2696,7 +2696,6 @@ bool Player::IsInSameRaidWith(Player const* p) const
}
///- If the player is invited, remove him. If the group if then only 1 person, disband the group.
/// @todo Shouldn't we also check if there is no other invitees before disbanding the group?
void Player::UninviteFromGroup()
{
Group* group = GetGroupInvite();
@@ -2705,13 +2704,14 @@ void Player::UninviteFromGroup()
group->RemoveInvite(this);
if (group->GetMembersCount() <= 1) // group has just 1 member => disband
if (group->IsCreated())
{
if (group->IsCreated())
{
if (group->GetMembersCount() <= 1) // group has just 1 member => disband
group->Disband(true);
}
else
}
else
{
if (group->GetInviteeCount() <= 1)
{
group->RemoveAllInvites();
delete group;
+1
View File
@@ -259,6 +259,7 @@ class TC_GAME_API Group
GroupReference* GetFirstMember() { return m_memberMgr.getFirst(); }
GroupReference const* GetFirstMember() const { return m_memberMgr.getFirst(); }
uint32 GetMembersCount() const { return m_memberSlots.size(); }
uint32 GetInviteeCount() const { return m_invitees.size(); }
GroupType GetGroupType() const { return m_groupType; }
uint8 GetMemberGroup(ObjectGuid guid) const;