Core/Spells: renamed SPELL_ATTR5_INCLUDE_MELEE_RANGE to SPELL_ATTR5_TREAT_AS_AREA_EFFECT and handle the attribute in SpellInfo::IsAffectingArea
This commit is contained in:
1 parent
d5fa8c3e10
commit
9892d239a8
3 files changed
+5
-2
No files matched your search
@@ -548,7 +548,7 @@ enum SpellAttr5
|
||||
SPELL_ATTR5_UNK12 = 0x00001000, // 12 Cleave related?
|
||||
SPELL_ATTR5_SPELL_HASTE_AFFECTS_PERIODIC = 0x00002000, // 13 Spell Haste Affects Periodic
|
||||
SPELL_ATTR5_NOT_USABLE_WHILE_CHARMED = 0x00004000, // 14 Charmed units cannot cast this spell
|
||||
SPELL_ATTR5_INCLUDE_MELEE_RANGE = 0x00008000, // 15 Area target selection includes the combat reach of caster and potential target
|
||||
SPELL_ATTR5_TREAT_AS_AREA_EFFECT = 0x00008000, // 15 Treat As Area Effect
|
||||
SPELL_ATTR5_UNK16 = 0x00010000, // 16
|
||||
SPELL_ATTR5_USABLE_WHILE_FEARED = 0x00020000, // 17 usable while feared
|
||||
SPELL_ATTR5_USABLE_WHILE_CONFUSED = 0x00040000, // 18 usable while confused
|
||||
|
||||
@@ -8509,7 +8509,7 @@ bool WorldObjectSpellAreaTargetCheck::operator()(WorldObject* target)
|
||||
}
|
||||
else if (target->ToUnit())
|
||||
{
|
||||
float hitboxSum = (_spellInfo->HasAttribute(SPELL_ATTR5_INCLUDE_MELEE_RANGE) && _spellInfo->SpellFamilyName != SPELLFAMILY_GENERIC) ? target->ToUnit()->GetMeleeRange(_caster) : 0.f;
|
||||
float hitboxSum = (_spellInfo->HasAttribute(SPELL_ATTR5_TREAT_AS_AREA_EFFECT) && _spellInfo->SpellFamilyName != SPELLFAMILY_GENERIC) ? target->ToUnit()->GetMeleeRange(_caster) : 0.f;
|
||||
bool isInsideCylinder = target->IsWithinDist2d(_position, _range + hitboxSum) && std::abs(target->GetPositionZ() - _position->GetPositionZ()) <= (_range + hitboxSum);
|
||||
if (!isInsideCylinder)
|
||||
return false;
|
||||
|
||||
@@ -1229,6 +1229,9 @@ bool SpellInfo::IsAbilityOfSkillType(uint32 skillType) const
|
||||
|
||||
bool SpellInfo::IsAffectingArea() const
|
||||
{
|
||||
if (HasAttribute(SPELL_ATTR5_TREAT_AS_AREA_EFFECT))
|
||||
return true;
|
||||
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (Effects[i].IsEffect() && (Effects[i].IsTargetingArea() || Effects[i].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA) || Effects[i].IsAreaAuraEffect()))
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user