mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 10:56:38 +01:00
Core/Spells: revert ec997a4715 and apply stricter rules to avoid unwanted behaivior
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user