Core/AI: Replace many Unit::IsHostileTo with Unit::IsValidAttackTarget or Creature::canCreatureAttack.
This commit is contained in:
@@ -701,26 +701,13 @@ namespace Trinity
|
||||
case SPELL_TARGETS_ENEMY:
|
||||
if (target->isTotem())
|
||||
continue;
|
||||
// can't be checked in SpellInfo::CheckTarget - needs more research
|
||||
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
|
||||
if (!i_source->_IsValidAttackTarget(target, i_spellProto))
|
||||
continue;
|
||||
if (target->HasUnitState(UNIT_STAT_UNATTACKABLE))
|
||||
continue;
|
||||
if (i_source->IsControlledByPlayer())
|
||||
{
|
||||
if (i_source->IsFriendlyTo(target))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!i_source->IsHostileTo(target))
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case SPELL_TARGETS_ALLY:
|
||||
if (target->isTotem())
|
||||
continue;
|
||||
if (!i_source->IsFriendlyTo(target))
|
||||
if (!i_source->_IsValidAssistTarget(target, i_spellProto))
|
||||
continue;
|
||||
break;
|
||||
case SPELL_TARGETS_ENTRY:
|
||||
|
||||
Reference in New Issue
Block a user