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).

(cherry picked from commit 250e8d998b)
This commit is contained in:
treeston
2017-06-15 13:08:26 +02:00
committed by Carbenium
parent 2d191a6680
commit e3077813d5
2 changed files with 7 additions and 6 deletions

View File

@@ -2252,7 +2252,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();
@@ -2261,13 +2260,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;

View File

@@ -328,6 +328,7 @@ class TC_GAME_API Group
GroupReference* GetFirstMember() { return m_memberMgr.getFirst(); }
GroupReference const* GetFirstMember() const { return m_memberMgr.getFirst(); }
uint32 GetMembersCount() const { return uint32(m_memberSlots.size()); }
uint32 GetInviteeCount() const { return m_invitees.size(); }
GroupFlags GetGroupFlags() const { return m_groupFlags; }
uint8 GetMemberGroup(ObjectGuid guid) const;