mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
[8088] Fixed min_range checking for spell casts.
Skip in check values 0.0f from DBC, this spells do not have min range limitation. This should fix some inappropriate target too close messages. Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
parent
2f3aa9bd71
commit
5d0f5f5421
2 changed files with 3 additions and 3 deletions
|
|
@ -4678,7 +4678,7 @@ SpellCastResult Spell::CheckRange(bool strict)
|
|||
|
||||
if(dist > max_range)
|
||||
return SPELL_FAILED_OUT_OF_RANGE; //0x5A;
|
||||
if(dist < min_range)
|
||||
if(min_range && dist < min_range)
|
||||
return SPELL_FAILED_TOO_CLOSE;
|
||||
if( m_caster->GetTypeId() == TYPEID_PLAYER &&
|
||||
(m_spellInfo->FacingCasterFlags & SPELL_FACING_FLAG_INFRONT) && !m_caster->HasInArc( M_PI, target ) )
|
||||
|
|
@ -4689,7 +4689,7 @@ SpellCastResult Spell::CheckRange(bool strict)
|
|||
{
|
||||
if(!m_caster->IsWithinDist3d(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, max_range))
|
||||
return SPELL_FAILED_OUT_OF_RANGE;
|
||||
if(m_caster->IsWithinDist3d(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, min_range))
|
||||
if(min_range && m_caster->IsWithinDist3d(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, min_range))
|
||||
return SPELL_FAILED_TOO_CLOSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue