diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index bf75c804a..95c5a1529 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -11493,12 +11493,12 @@ Unit* Creature::SelectVictim() return target; } - // last case when creature must not go to evade mode: - // it in combat but attacker not make any damage and not enter to aggro radius to have record in threat list - // Note: creature does not have targeted movement generator but has attacker in this case - for (AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr) - if ((*itr) && CanCreatureAttack(*itr) && !(*itr)->IsPlayer() && !(*itr)->ToCreature()->HasUnitTypeMask(UNIT_MASK_CONTROLLABLE_GUARDIAN)) - return nullptr; + // Don't evade if another unit has us on their threat list — evading would + // end the bidirectional combat reference and remove us from their threat list, + // causing them to lose their target (e.g. an NPC fighting a guardian whose + // CanAIAttack rejects the NPC). + if (!m_threatManager.GetThreatenedByMeList().empty()) + return nullptr; if (GetVehicle()) return nullptr;