mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 01:37:00 +00:00
[c12616] Simplify use of CombatReach
This commit is contained in:
parent
e478b27dcc
commit
dc3de04d62
6 changed files with 36 additions and 22 deletions
|
|
@ -1683,7 +1683,7 @@ SpellEntry const* Creature::ReachWithSpellAttack(Unit* pVictim)
|
|||
float range = GetSpellMaxRange(srange);
|
||||
float minrange = GetSpellMinRange(srange);
|
||||
|
||||
float dist = GetCombatDistance(pVictim);
|
||||
float dist = GetCombatDistance(pVictim, spellInfo->rangeIndex == SPELL_RANGE_IDX_COMBAT);
|
||||
|
||||
// if(!isInFront( pVictim, range ) && spellInfo->AttributesEx )
|
||||
// continue;
|
||||
|
|
@ -1739,7 +1739,7 @@ SpellEntry const* Creature::ReachWithSpellCure(Unit* pVictim)
|
|||
float range = GetSpellMaxRange(srange);
|
||||
float minrange = GetSpellMinRange(srange);
|
||||
|
||||
float dist = GetCombatDistance(pVictim);
|
||||
float dist = GetCombatDistance(pVictim, spellInfo->rangeIndex == SPELL_RANGE_IDX_COMBAT);
|
||||
|
||||
// if(!isInFront( pVictim, range ) && spellInfo->AttributesEx )
|
||||
// continue;
|
||||
|
|
@ -2096,7 +2096,7 @@ bool Creature::MeetsSelectAttackingRequirement(Unit* pTarget, SpellEntry const*
|
|||
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(pSpellInfo->rangeIndex);
|
||||
float max_range = GetSpellMaxRange(srange);
|
||||
float min_range = GetSpellMinRange(srange);
|
||||
float dist = GetCombatDistance(pTarget);
|
||||
float dist = GetCombatDistance(pTarget, false);
|
||||
|
||||
return dist < max_range && dist >= min_range;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue