more target validation for bots to prevent pets from getting hit with AEs and pets trying to attack invalid targets

This commit is contained in:
nytmyr
2024-11-06 07:31:48 -06:00
parent 1d6d6a0f36
commit 95bf30740f
2 changed files with 26 additions and 2 deletions
+7
View File
@@ -2116,6 +2116,13 @@ void Bot::AI_Process()
// TARGET VALIDATION
if (!IsValidTarget(bot_owner, leash_owner, lo_distance, leash_distance, tar, tar_distance)) {
if (HasPet()) {
if (tar && GetPet()->GetTarget() && GetPet()->GetTarget() == tar) {
GetPet()->WipeHateList();
GetPet()->SetTarget(nullptr);
}
}
return;
}