[Bug Fix] Fix issue with Group Pointers/Member roles (#3374)

* [Bug Fix] Fix issue with Group Corruption

* cleanup

* Fix for Group Roles

* Fix for Group Roles
This commit is contained in:
Aeadoin 2023-05-24 23:40:59 -04:00 committed by GitHub
parent 39d0772a01
commit 290c58741e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 23 deletions

View File

@ -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;

View File

@ -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) {