fix(Core/Combat): Removed some invalid code about auto-acquiring a nearby target if primary target is not detectable by creature. (#8624)

Spells with sanctuary always delete hostile references (if not during encounter).
Update visibility should be always forced in case of invisibility/stealth auras.
Restored old Shadowmeld code.
Fixes #4764
Fixes #7125
This commit is contained in:
UltraNix
2021-10-21 20:54:36 +02:00
committed by GitHub
parent 0717fae239
commit db0c27fe43
5 changed files with 12 additions and 81 deletions

View File

@@ -13896,14 +13896,6 @@ Unit* Creature::SelectVictim()
if (GetVehicle())
return nullptr;
// search nearby enemies before evading
if (HasReactState(REACT_AGGRESSIVE))
{
target = SelectNearestTargetInAttackDistance(std::max<float>(m_CombatDistance, ATTACK_DISTANCE));
if (target && _CanDetectFeignDeathOf(target) && CanCreatureAttack(target))
return target;
}
// pussywizard: not sure why it's here
// pussywizard: can't evade when having invisibility aura with duration? o_O
Unit::AuraEffectList const& iAuras = GetAuraEffectsByType(SPELL_AURA_MOD_INVISIBILITY);