diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 77e4bb2ef..4062311aa 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1514,30 +1514,31 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) } if (group) { - // If the group leader is not set, pull the group leader infomrmation from the database. - if (!group->GetLeader()) { - char ln[64]; - char MainTankName[64]; - char AssistName[64]; - char PullerName[64]; - char NPCMarkerName[64]; - char mentoree_name[64]; - int mentor_percent; - GroupLeadershipAA_Struct GLAA; - memset(ln, 0, 64); - database.GetGroupLeadershipInfo(group->GetID(), ln, MainTankName, AssistName, PullerName, NPCMarkerName, mentoree_name, &mentor_percent, &GLAA); - Client *c = entity_list.GetClientByName(ln); - if (c) - group->SetLeader(c); - - group->SetMainTank(MainTankName); - group->SetMainAssist(AssistName); - group->SetPuller(PullerName); - group->SetNPCMarker(NPCMarkerName); - group->SetGroupAAs(&GLAA); - group->SetGroupMentor(mentor_percent, mentoree_name); - } + char ln[64]; + char MainTankName[64]; + char AssistName[64]; + char PullerName[64]; + char NPCMarkerName[64]; + char mentoree_name[64]; + int mentor_percent; + GroupLeadershipAA_Struct GLAA; + memset(ln, 0, 64); + database.GetGroupLeadershipInfo(group->GetID(), ln, MainTankName, AssistName, PullerName, NPCMarkerName, mentoree_name, &mentor_percent, &GLAA); group->LearnMembers(); + + if (!group->GetLeader()) { + Client *c = entity_list.GetClientByName(ln); + if (c) { + group->SetLeader(c); + } + } + + group->SetMainTank(MainTankName); + group->SetMainAssist(AssistName); + group->SetPuller(PullerName); + group->SetNPCMarker(NPCMarkerName); + group->SetGroupAAs(&GLAA); + group->SetGroupMentor(mentor_percent, mentoree_name); JoinGroupXTargets(group); group->UpdatePlayer(this); LFG = false; diff --git a/zone/groups.cpp b/zone/groups.cpp index 238f8f18e..73f4062f4 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -1156,6 +1156,13 @@ bool Group::LearnMembers() { ); } + for(int i = 0; i < MAX_GROUP_MEMBERS; ++i) + { + members[i] = nullptr; + memset(membername[i],0,64); + MemberRoles[i] = 0; + } + int memberIndex = 0; for (const auto& member : rows) { if (memberIndex >= MAX_GROUP_MEMBERS) {