Core/Spells: Fix area target search for spells with SPELL_ATTR2_ALLOW_DEAD_TARGET
This commit is contained in:
@@ -11986,9 +11986,15 @@ bool Unit::canAttack(Unit const* target, bool force) const
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Unit::isAttackableByAOE(bool requireDeadTarget) const
|
||||
bool Unit::isAttackableByAOE(SpellEntry const * spellProto) const
|
||||
{
|
||||
if (isAlive() == requireDeadTarget)
|
||||
bool targetMustBeDead = spellProto ? bool(spellProto->AttributesEx3 & SPELL_ATTR3_REQUIRE_DEAD_TARGET) : false;
|
||||
bool targetCanBeDead = spellProto ? bool(spellProto->AttributesEx2 & SPELL_ATTR2_ALLOW_DEAD_TARGET) : false;
|
||||
|
||||
if (targetMustBeDead && isAlive())
|
||||
return false;
|
||||
|
||||
if (!targetMustBeDead && !targetCanBeDead && !isAlive())
|
||||
return false;
|
||||
|
||||
if (HasFlag(UNIT_FIELD_FLAGS,
|
||||
|
||||
@@ -1473,7 +1473,7 @@ class Unit : public WorldObject
|
||||
bool isFrozen() const;
|
||||
|
||||
bool isTargetableForAttack() const;
|
||||
bool isAttackableByAOE(bool requireDeadTarget = false) const;
|
||||
bool isAttackableByAOE(SpellEntry const * spellProto = NULL) const;
|
||||
bool canAttack(Unit const* target, bool force = true) const;
|
||||
virtual bool IsInWater() const;
|
||||
virtual bool IsUnderWater() const;
|
||||
|
||||
Reference in New Issue
Block a user