mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
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:
parent
66d37cabe4
commit
7f30950fdb
14
zone/bot.cpp
14
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++) {
|
||||
@ -5897,6 +5895,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
|
||||
int j = i+1;
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user