Core/Spells: Spells with the self-cast range should not have a range check. This range used for many triggered spells.

Fixes #3358
This commit is contained in:
Liberate
2011-10-19 00:24:43 +02:00
parent 6d12deb5b5
commit 8f8949fcf0
+10 -1
View File
@@ -5639,7 +5639,16 @@ SpellCastResult Spell::CheckRange(bool strict)
if (!strict && m_casttime == 0)
return SPELL_CAST_OK;
uint32 range_type = m_spellInfo->RangeEntry ? m_spellInfo->RangeEntry->type : 0;
uint32 range_type = 0;
if (m_spellInfo->RangeEntry)
{
// self cast is used for triggered spells, no range checking needed
if (m_spellInfo->RangeEntry->ID == 1)
return SPELL_CAST_OK;
range_type = m_spellInfo->RangeEntry->type;
}
Unit* target = m_targets.GetUnitTarget();
float max_range = m_caster->GetSpellMaxRangeForTarget(target, m_spellInfo);