mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 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
|
|
@ -56,7 +56,7 @@ CanCastResult CreatureAI::CanCastSpell(Unit* pTarget, const SpellEntry* pSpell,
|
|||
if (pTarget != m_creature)
|
||||
{
|
||||
// pTarget is out of range of this spell (also done by Spell::CheckCast())
|
||||
float fDistance = m_creature->GetCombatDistance(pTarget);
|
||||
float fDistance = m_creature->GetCombatDistance(pTarget, pSpell->rangeIndex == SPELL_RANGE_IDX_COMBAT);
|
||||
|
||||
if (fDistance > (m_creature->IsHostileTo(pTarget) ? pSpellRange->maxRange : pSpellRange->maxRangeFriendly))
|
||||
return CAST_FAIL_TOO_FAR;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue