Core/Spells: revert ec997a4715 and apply stricter rules to avoid unwanted behaivior

This commit is contained in:
Ovahlord
2020-08-30 14:30:55 +02:00
parent ec997a4715
commit aba4da0898
2 changed files with 2 additions and 2 deletions

View File

@@ -547,7 +547,7 @@ enum SpellAttr5
SPELL_ATTR5_UNK12 = 0x00001000, // 12 Cleave related?
SPELL_ATTR5_HASTE_AFFECT_DURATION = 0x00002000, // 13 haste effects decrease duration of this
SPELL_ATTR5_UNK14 = 0x00004000, // 14
SPELL_ATTR5_UNK15 = 0x00008000, // 15
SPELL_ATTR5_INCLUDE_MELEE_RANGE = 0x00008000, // 15 Area target selection includes the combat reach of caster and potential target
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

View File

@@ -8375,7 +8375,7 @@ bool WorldObjectSpellAreaTargetCheck::operator()(WorldObject* target)
}
else if (target->ToUnit())
{
float hitboxSum = _spellInfo->SpellFamilyName != SPELLFAMILY_GENERIC ? target->ToUnit()->GetMeleeRange(_caster) : 0.f;
float hitboxSum = (_spellInfo->HasAttribute(SPELL_ATTR5_INCLUDE_MELEE_RANGE) && _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;