I 'think' that I found the two places that were causing issues...
I'm still testing out this patch, but it appears to be working. I made it through level 10 with no bug triggers.
It still needs to be looked over..and it only affects bot code.
Code:
zone/bot.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/zone/bot.cpp b/zone/bot.cpp
index 51b649b..963cd2a 100644
--- a/zone/bot.cpp
+++ b/zone/bot.cpp
@@ -3122,7 +3122,7 @@ bool Bot::Process()
// Bot AI
AI_Process();
- // Bot Pet AI
+ // Bot Pet AI // Remove when/if all bot pet features are transfered to NPC::AI_Process()
if(HasPet())
PetAIProcess();
@@ -3594,7 +3594,8 @@ void Bot::AI_Process() {
if(g) {
for(int counter = 0; counter < g->GroupCount(); counter++) {
if(g->members[counter]) {
- if(g->members[counter]->IsEngaged() && g->members[counter]->GetTarget()) {
+ if(g->members[counter]->IsEngaged() && g->members[counter]->GetTarget() &&
+ g->members[counter]->GetTarget() != this && this->IsAttackAllowed(g->members[counter]->GetTarget())) {
AddToHateList(g->members[counter]->GetTarget(), 1);
if(HasPet())
@@ -6364,8 +6365,10 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillType attack_skil
SendHPUpdate();
+ if(this == from) { return; } // IsAttackAllowed() check below returns true for 'this = this'
+
// Aggro the bot's group members
- if(IsGrouped())
+ if(IsGrouped() && IsAttackAllowed(from))
{
Group *g = GetGroup();
if(g)
I got the invalid target message from bot pets when the enchanter had a target mezzed, but this did not trigger the
Extended Target bug.
Another instance, about mid-fight in a level 12 melee, the message popped up once, but no trigger of the bug.
(The above testing was done with a fresh character and bots. I did go back with my bot mob and try to get this to
trigger in the mid-30's range - Shaman Cannibalize - and no hits there after ~150 fights.)