mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[BUG] Fix for Group Leader Disband Issue
Added public/private class for oldleadername so we can save the previous leader name when the entity is destroyed then allow us to transfer leadership. Adjusted DelmemberOOZ and in zone functions to include removal of the old leader when disbanding.
This commit is contained in:
+32
-6
@@ -4209,7 +4209,7 @@ void EntityList::ForceGroupUpdate(uint32 gid)
|
||||
}
|
||||
}
|
||||
|
||||
void EntityList::SendGroupLeave(uint32 gid, const char *name)
|
||||
void EntityList::SendGroupLeave(uint32 gid, const char *name, bool checkleader)
|
||||
{
|
||||
auto it = client_list.begin();
|
||||
while (it != client_list.end()) {
|
||||
@@ -4225,13 +4225,39 @@ void EntityList::SendGroupLeave(uint32 gid, const char *name)
|
||||
gj->action = groupActLeave;
|
||||
strcpy(gj->yourname, c->GetName());
|
||||
Mob *Leader = g->GetLeader();
|
||||
if (Leader)
|
||||
if (Leader) {
|
||||
Leader->CastToClient()->GetGroupAAs(&gj->leader_aas);
|
||||
}
|
||||
c->QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
g->DelMemberOOZ(name);
|
||||
if (g->IsLeader(c) && c->IsLFP())
|
||||
g->DelMemberOOZ(name, checkleader);
|
||||
if (g->IsLeader(c) && c->IsLFP()) {
|
||||
c->UpdateLFP();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
void EntityList::SendGroupLeader(uint32 gid, const char *lname, const char *oldlname)
|
||||
{
|
||||
auto it = client_list.begin();
|
||||
while (it != client_list.end()) {
|
||||
if (it->second){
|
||||
Group *g = nullptr;
|
||||
g = it->second->GetGroup();
|
||||
if (g) {
|
||||
if (g->GetID() == gid) {
|
||||
EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate,sizeof(GroupJoin_Struct));
|
||||
GroupJoin_Struct* gj = (GroupJoin_Struct*) outapp->pBuffer;
|
||||
gj->action = groupActMakeLeader;
|
||||
strcpy(gj->membername, lname);
|
||||
strcpy(gj->yourname, oldlname);
|
||||
it->second->QueuePacket(outapp);
|
||||
Log(Logs::Detail, Logs::Group, "SendGroupLeader(): Entity loop leader update packet sent to: %s .", it->second->GetName());
|
||||
safe_delete(outapp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4254,9 +4280,9 @@ void EntityList::SendGroupJoin(uint32 gid, const char *name)
|
||||
gj->action = groupActJoin;
|
||||
strcpy(gj->yourname, it->second->GetName());
|
||||
Mob *Leader = g->GetLeader();
|
||||
if (Leader)
|
||||
if (Leader) {
|
||||
Leader->CastToClient()->GetGroupAAs(&gj->leader_aas);
|
||||
|
||||
}
|
||||
it->second->QueuePacket(outapp);
|
||||
safe_delete(outapp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user