mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +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
|
|
@ -1586,7 +1586,12 @@ SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim)
|
|||
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex);
|
||||
float range = GetSpellMaxRange(srange);
|
||||
float minrange = GetSpellMinRange(srange);
|
||||
float dist = GetDistance(pVictim);
|
||||
|
||||
// DasMy: respect victims dimensions
|
||||
float dist = GetDistance(pVictim) - pVictim->GetFloatValue(UNIT_FIELD_COMBATREACH) - GetFloatValue(UNIT_FIELD_COMBATREACH);
|
||||
if (dist < 0.0f)
|
||||
dist = 0.0f;
|
||||
|
||||
//if(!isInFront( pVictim, range ) && spellInfo->AttributesEx )
|
||||
// continue;
|
||||
if( dist > range || dist < minrange )
|
||||
|
|
@ -1632,7 +1637,12 @@ SpellEntry const *Creature::reachWithSpellCure(Unit *pVictim)
|
|||
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(spellInfo->rangeIndex);
|
||||
float range = GetSpellMaxRange(srange);
|
||||
float minrange = GetSpellMinRange(srange);
|
||||
float dist = GetDistance(pVictim);
|
||||
|
||||
// DasMy: respect victims dimensions
|
||||
float dist = GetDistance(pVictim) - pVictim->GetFloatValue(UNIT_FIELD_COMBATREACH) - GetFloatValue(UNIT_FIELD_COMBATREACH);
|
||||
if (dist < 0.0f)
|
||||
dist = 0.0f;
|
||||
|
||||
//if(!isInFront( pVictim, range ) && spellInfo->AttributesEx )
|
||||
// continue;
|
||||
if( dist > range || dist < minrange )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue