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.

This commit is contained in:
Natedog2012 2015-06-03 10:08:55 -07:00
parent 66d37cabe4
commit 7f30950fdb
2 changed files with 14 additions and 10 deletions

View File

@ -758,6 +758,7 @@ void Bot::GenerateBaseStats() {
this->pAggroRange = 0; this->pAggroRange = 0;
this->pAssistRange = 0; this->pAssistRange = 0;
this->raid_target = false;
} }
void Bot::GenerateAppearance() { void Bot::GenerateAppearance() {
@ -5292,9 +5293,6 @@ bool Bot::RemoveBotFromGroup(Bot* bot, Group* group) {
if(group->DelMember(bot)) if(group->DelMember(bot))
database.SetGroupID(bot->GetCleanName(), 0, bot->GetBotID()); database.SetGroupID(bot->GetCleanName(), 0, bot->GetBotID());
if(group->GroupCount() <= 1 && ZoneLoaded)
group->DisbandGroup();
} }
else { else {
for(int i = 0; i < MAX_GROUP_MEMBERS; i++) { 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 // delete from group data
RemoveBotFromGroup(this, g); 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 // if group members exist below this one, move
// them all up one slot in the group list // 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 // update the client group
EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct)); EQApplicationPacket* outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct));
GroupJoin_Struct* gu = (GroupJoin_Struct*)outapp->pBuffer; GroupJoin_Struct* gu = (GroupJoin_Struct*)outapp->pBuffer;

View File

@ -6354,10 +6354,16 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app)
Bot::ProcessBotGroupDisband(this, std::string()); Bot::ProcessBotGroupDisband(this, std::string());
} }
else { 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) {
if (tempMember->IsBot()) 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
} }
} }
} }