mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
[Bots] Fix ^oo autodefend from sending bots/pets to invalid haters (#3772)
Bots and especially their pets could get in a loop where they try to attack an invalid target. This would result in their pets spamming "That is not a legal target" messages.
This commit is contained in:
parent
fcb40daaf1
commit
4d118ab978
@ -2357,7 +2357,7 @@ bool Bot::TryAutoDefend(Client* bot_owner, float leash_distance) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto hater = entity_list.GetMob(hater_iter.spawn_id);
|
auto hater = entity_list.GetMob(hater_iter.spawn_id);
|
||||||
if (hater && !hater->IsMezzed() && DistanceSquared(hater->GetPosition(), bot_owner->GetPosition()) <= leash_distance) {
|
if (hater && hater->CastToNPC()->IsOnHatelist(bot_owner) && !hater->IsMezzed() && DistanceSquared(hater->GetPosition(), bot_owner->GetPosition()) <= leash_distance) {
|
||||||
// This is roughly equivilent to npc attacking a client pet owner
|
// This is roughly equivilent to npc attacking a client pet owner
|
||||||
AddToHateList(hater, 1);
|
AddToHateList(hater, 1);
|
||||||
SetTarget(hater);
|
SetTarget(hater);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user