Core/Spells: check UNIT_FLAG_OOC_NOT_ATTACKABLE only for AOE spells targeting enemies, fixes some interactions with npcs.

This commit is contained in:
QAston
2011-08-20 12:08:37 +02:00
parent 919a8ecf0e
commit b838aad7d0
3 changed files with 4 additions and 2 deletions
-1
View File
@@ -1547,7 +1547,6 @@ class Unit : public WorldObject
bool isFrozen() const; bool isFrozen() const;
bool isTargetableForAttack(bool checkFakeDeath = true) const; bool isTargetableForAttack(bool checkFakeDeath = true) const;
bool isAttackableByAOE(SpellInfo const* spellProto = NULL) const;
bool canAttack(Unit const* target, bool force = true) const; bool canAttack(Unit const* target, bool force = true) const;
virtual bool IsInWater() const; virtual bool IsInWater() const;
virtual bool IsUnderWater() const; virtual bool IsUnderWater() const;
+3
View File
@@ -727,6 +727,9 @@ namespace Trinity
case SPELL_TARGETS_ENEMY: case SPELL_TARGETS_ENEMY:
if (target->isTotem()) if (target->isTotem())
continue; continue;
// can't be checked in SpellInfo::CheckTarget - needs more research
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE))
continue;
if (i_source->IsControlledByPlayer()) if (i_source->IsControlledByPlayer())
{ {
if (i_source->IsFriendlyTo(target)) if (i_source->IsFriendlyTo(target))
+1 -1
View File
@@ -1529,7 +1529,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, b
if (target != caster && target->GetCharmerOrOwnerGUID() != caster->GetGUID()) if (target != caster && target->GetCharmerOrOwnerGUID() != caster->GetGUID())
{ {
// any unattackable target skipped // any unattackable target skipped
if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_OOC_NOT_ATTACKABLE)) if (target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
return SPELL_FAILED_BAD_TARGETS; return SPELL_FAILED_BAD_TARGETS;
} }