mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user