mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
fix(Core/Groups): Create the group at first invite (#17869)
* cherry-pick commit (132538db1d) * cherry-pick commit (250e8d998b) * part https://github.com/azerothcore/azerothcore-wotlk/issues/11070 Co-authored-by: Treeston <14020072+Treeston@users.noreply.github.com>
This commit is contained in:
@@ -2298,7 +2298,6 @@ bool Player::IsInSameGroupWith(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();
|
||||
@@ -2307,14 +2306,17 @@ 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);
|
||||
group = nullptr; // gets deleted in disband
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (group->GetInviteeCount() <= 1)
|
||||
{
|
||||
group->RemoveAllInvites();
|
||||
delete group;
|
||||
|
||||
Reference in New Issue
Block a user