Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Crash] Fixes Crash when Zoning with XTarget when Bots are in group. #3126

Merged
merged 1 commit into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions zone/bot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5457,6 +5457,7 @@ void Bot::ProcessBotOwnerRefDelete(Mob* botOwner) {
if (tempBot) {
tempBot->SetTarget(nullptr);
tempBot->SetBotOwner(nullptr);
tempBot->Zone();
}
}
}
Expand Down
13 changes: 6 additions & 7 deletions zone/groups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,6 @@ bool Group::UpdatePlayer(Mob* update) {
return updateSuccess;
}


void Group::MemberZoned(Mob* removemob) {
uint32 i;

Expand All @@ -554,11 +553,10 @@ void Group::MemberZoned(Mob* removemob) {
if(removemob == GetLeader())
SetLeader(nullptr);

for (i = 0; i < MAX_GROUP_MEMBERS; i++) {
if (members[i] == removemob) {
members[i] = nullptr;
//should NOT clear the name, it is used for world communication.
break;
//should NOT clear the name, it is used for world communication.
for (auto & m : members) {
if (m && (m == removemob || m->IsBot() && m->CastToBot()->GetBotOwner() == removemob)) {
m = nullptr;
}
Aeadoin marked this conversation as resolved.
Show resolved Hide resolved
}

Expand Down Expand Up @@ -924,6 +922,7 @@ void Group::DisbandGroup(bool joinraid) {
{
if (members[i] == nullptr)
{
membername[i][0] = '\0';
continue;
}

Expand Down Expand Up @@ -1166,6 +1165,7 @@ bool Group::LearnMembers() {
memberIndex++;
}

VerifyGroup();
return true;
}

Expand Down Expand Up @@ -2321,7 +2321,6 @@ void Group::UpdateXTargetMarkedNPC(uint32 Number, Mob *m)
members[i]->CastToClient()->UpdateXTargetType((Number == 1) ? GroupMarkTarget1 : ((Number == 2) ? GroupMarkTarget2 : GroupMarkTarget3), m);
}
}

}

void Group::SetDirtyAutoHaters()
Expand Down
4 changes: 2 additions & 2 deletions zone/raids.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1952,10 +1952,10 @@ void Raid::QueueClients(Mob *sender, const EQApplicationPacket *app, bool ack_re
if (!members[i].member) {
continue;
}
if (!members[i].member->IsClient()) {
if (members[i].IsBot) {
continue;
}
if (members[i].IsBot) {
if (!members[i].member->IsClient()) {
continue;
}
if (ignore_sender && members[i].member == sender) {
Expand Down