Skip to content

Commit

Permalink
Core/Spells: check UNIT_FLAG_OOC_NOT_ATTACKABLE only for AOE spells t…
Browse files Browse the repository at this point in the history
…argeting enemies, fixes some interactions with npcs.
  • Loading branch information
QAston committed Aug 20, 2011
1 parent 919a8ec commit b838aad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/server/game/Entities/Unit/Unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,6 @@ class Unit : public WorldObject
bool isFrozen() const;

bool isTargetableForAttack(bool checkFakeDeath = true) const;
bool isAttackableByAOE(SpellInfo const* spellProto = NULL) const;
bool canAttack(Unit const* target, bool force = true) const;
virtual bool IsInWater() const;
virtual bool IsUnderWater() const;
Expand Down
3 changes: 3 additions & 0 deletions src/server/game/Spells/Spell.h
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,9 @@ 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))
continue;
if (i_source->IsControlledByPlayer())
{
if (i_source->IsFriendlyTo(target))
Expand Down
2 changes: 1 addition & 1 deletion src/server/game/Spells/SpellInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, Unit const* target, b
if (target != caster && target->GetCharmerOrOwnerGUID() != caster->GetGUID())
{
// 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;
}

Expand Down

0 comments on commit b838aad

Please sign in to comment.