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 2dfa1681c4
commit 775511c935
2 changed files with 26 additions and 2 deletions
+7
View File
@@ -2113,6 +2113,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;
}