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

This commit is contained in:
Aeadoin 2023-03-19 08:26:16 -04:00 committed by GitHub
parent a6efb1e8b5
commit 53e6f931c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -5457,6 +5457,7 @@ void Bot::ProcessBotOwnerRefDelete(Mob* botOwner) {
if (tempBot) {
tempBot->SetTarget(nullptr);
tempBot->SetBotOwner(nullptr);
tempBot->Zone();
}
}
}

View File

@ -544,7 +544,6 @@ bool Group::UpdatePlayer(Mob* update) {
return updateSuccess;
}
void Group::MemberZoned(Mob* removemob) {
uint32 i;
@ -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;
}
}
@ -924,6 +922,7 @@ void Group::DisbandGroup(bool joinraid) {
{
if (members[i] == nullptr)
{
membername[i][0] = '\0';
continue;
}
@ -1166,6 +1165,7 @@ bool Group::LearnMembers() {
memberIndex++;
}
VerifyGroup();
return true;
}
@ -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()

View File

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