mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7570] respect UNIT_FIELD_COMBATREACH for spell range check
Signed-off-by: arrai <array.of.intellect@gmail.com>
This commit is contained in:
parent
910d4c8155
commit
6762744452
3 changed files with 18 additions and 5 deletions
|
|
@ -4749,8 +4749,11 @@ SpellCastResult Spell::CheckRange(bool strict)
|
|||
|
||||
if(target && target != m_caster)
|
||||
{
|
||||
// distance from target center in checks
|
||||
float dist = m_caster->GetDistance(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ());
|
||||
// distance from target in checks
|
||||
float dist = m_caster->GetDistance(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ()) - target->GetFloatValue(UNIT_FIELD_COMBATREACH) - m_caster->GetFloatValue(UNIT_FIELD_COMBATREACH); // DasMy: respect victims dimension
|
||||
if (dist < 0.0f)
|
||||
dist = 0.0f;
|
||||
|
||||
if(dist > max_range)
|
||||
return SPELL_FAILED_OUT_OF_RANGE; //0x5A;
|
||||
if(dist < min_range)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue