mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
Quick fix to resolve some serious group issues
Group leader swapping didn't work and left the client in a bad state This just disbands the group if the leader leaves Also prevents a group leader from disbanding other groups ... Which also lead to bad states Group leader swapping not working is better than these issues :P
This commit is contained in:
+11
-7
@@ -6506,6 +6506,16 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app)
|
||||
if (!group) //We must recheck this here.. incase the final bot disbanded the party..otherwise we crash
|
||||
return;
|
||||
#endif
|
||||
Mob* memberToDisband = GetTarget();
|
||||
|
||||
if (!memberToDisband)
|
||||
memberToDisband = entity_list.GetMob(gd->name2);
|
||||
|
||||
if (memberToDisband) {
|
||||
auto group2 = memberToDisband->GetGroup();
|
||||
if (group2 != group) // they're not in our group!
|
||||
memberToDisband = this;
|
||||
}
|
||||
|
||||
if (group->GroupCount() < 3)
|
||||
{
|
||||
@@ -6527,7 +6537,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app)
|
||||
GetMerc()->Suspend();
|
||||
}
|
||||
}
|
||||
else if (group->IsLeader(this) && GetTarget() == this)
|
||||
else if (group->IsLeader(this) && (GetTarget() == this || memberToDisband == this))
|
||||
{
|
||||
LeaveGroup();
|
||||
if (GetMerc() && !GetMerc()->IsSuspended())
|
||||
@@ -6537,12 +6547,6 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app)
|
||||
}
|
||||
else
|
||||
{
|
||||
Mob* memberToDisband = nullptr;
|
||||
memberToDisband = GetTarget();
|
||||
|
||||
if (!memberToDisband)
|
||||
memberToDisband = entity_list.GetMob(gd->name2);
|
||||
|
||||
if (memberToDisband)
|
||||
{
|
||||
if (group->IsLeader(this))
|
||||
|
||||
Reference in New Issue
Block a user