Core/Spells: Fix area target search for spells with SPELL_ATTR2_ALLOW_DEAD_TARGET

This commit is contained in:
Shocker
2011-04-06 17:00:05 +03:00
parent 364bb162c3
commit ba80f2fbdc
4 changed files with 16 additions and 8 deletions
+8 -2
View File
@@ -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,
+1 -1
View File
@@ -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;