Kitzunu
2023-11-26 20:34:45 +01:00
committed by GitHub
parent 911f07c906
commit f440a7479f
3 changed files with 51 additions and 48 deletions
+6 -4
View File
@@ -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;