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:
Ovahlord committed 2022-01-16 11:44:49 +01:00
1 parent d5fa8c3e10
commit 9892d239a8
3 files changed
+5 -2

No files matched your search

+1 -1
View File
@@ -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;