Skip to content

Commit

Permalink
[Crash] Fixes Crash when Zoning with XTarget when Bots are in group. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Aeadoin committed Mar 19, 2023
1 parent a6efb1e commit 53e6f93
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
1 change: 1 addition & 0 deletions zone/bot.cpp
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
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;
}
}

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

0 comments on commit 53e6f93

Please sign in to comment.