From 7f30950fdbbe3b33a0630804abcf8861e0425685 Mon Sep 17 00:00:00 2001 From: Natedog2012 Date: Wed, 3 Jun 2015 10:08:55 -0700 Subject: [PATCH] More group related bot crashes fixed. Bots can now be targeted in the group window and kicked from party. They are also no longer raid_targets when conned. --- zone/bot.cpp | 14 ++++++-------- zone/client_packet.cpp | 10 ++++++++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index ebc5f47d3..e76389b24 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -758,6 +758,7 @@ void Bot::GenerateBaseStats() { this->pAggroRange = 0; this->pAssistRange = 0; + this->raid_target = false; } void Bot::GenerateAppearance() { @@ -5292,9 +5293,6 @@ bool Bot::RemoveBotFromGroup(Bot* bot, Group* group) { if(group->DelMember(bot)) database.SetGroupID(bot->GetCleanName(), 0, bot->GetBotID()); - - if(group->GroupCount() <= 1 && ZoneLoaded) - group->DisbandGroup(); } else { for(int i = 0; i < MAX_GROUP_MEMBERS; i++) { @@ -5896,6 +5894,11 @@ bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, SkillUseTypes att // delete from group data RemoveBotFromGroup(this, g); + + //Make sure group still exists if it doesnt they were already updated in RemoveBotFromGroup + g = GetGroup(); + if (!g) + break; // if group members exist below this one, move // them all up one slot in the group list @@ -5910,11 +5913,6 @@ bool Bot::Death(Mob *killerMob, int32 damage, uint16 spell_id, SkillUseTypes att } } - //Make sure group still exists if it doesnt they were already updated in RemoveBotFromGroup - g = GetGroup(); - if (!g) - break; - // update the client group EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct)); GroupJoin_Struct* gu = (GroupJoin_Struct*)outapp->pBuffer; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index ccb27a188..b9dfb1c69 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -6354,10 +6354,16 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) Bot::ProcessBotGroupDisband(this, std::string()); } else { - Mob* tempMember = entity_list.GetMob(gd->name2); + Mob* tempMember = entity_list.GetMob(gd->name1); //Name1 is the target you are disbanding if (tempMember) { if (tempMember->IsBot()) - Bot::ProcessBotGroupDisband(this, std::string(tempMember->GetCleanName())); + tempMember->CastToBot()->RemoveBotFromGroup(tempMember->CastToBot(), group); + if (LFP) + { + // If we are looking for players, update to show we are on our own now. + UpdateLFP(); + } + return; //No need to continue from here we were removing a bot from party } } }