aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorthenecromancer <none@none>2010-03-07 14:32:53 +0100
committerthenecromancer <none@none>2010-03-07 14:32:53 +0100
commitaeebe57dc08d8b2d90972f50f00c4a28dd3947ba (patch)
tree46cc88030561f1a43944b4471037b3af9be83f5b /src
parent34bc948f371441e20e19d0bf57a7ff7d95103e03 (diff)
Remove 94567c94e6, instead don't check range/facing when finishing instant cast spells
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Spell.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp
index 834e9c23b7f..798db319dad 100644
--- a/src/game/Spell.cpp
+++ b/src/game/Spell.cpp
@@ -2826,7 +2826,7 @@ void Spell::cast(bool skipCheck)
if(!m_IsTriggeredSpell || !skipCheck)
{
SpellCastResult castResult = CheckCast(false);
- if(castResult != SPELL_CAST_OK && !(m_spellInfo->Attributes & SPELL_ATTR_ONLY_STEALTHED))
+ if(castResult != SPELL_CAST_OK)
{
SendCastResult(castResult);
SendInterrupted(0);
@@ -5504,22 +5504,18 @@ bool Spell::CanAutoCast(Unit* target)
SpellCastResult Spell::CheckRange(bool strict)
{
- //float range_mod;
-
// self cast doesn't need range checking -- also for Starshards fix
if (m_spellInfo->rangeIndex == 1)
return SPELL_CAST_OK;
- // i do not know why we need this
- /*if (strict) //add radius of caster
- range_mod = 1.25;
- else //add radius of caster and ~5 yds "give"
- range_mod = 6.25;*/
+ // Don't check for instant cast spells
+ if (!strict && m_casttime == 0)
+ return SPELL_CAST_OK;
SpellRangeEntry const* srange = sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex);
Unit *target = m_targets.getUnitTarget();
- float max_range = m_caster->GetSpellMaxRangeForTarget(target, srange); // + range_mod;
+ float max_range = m_caster->GetSpellMaxRangeForTarget(target, srange);
float min_range = m_caster->GetSpellMinRangeForTarget(target, srange);
uint32 range_type = GetSpellRangeType(srange);
@@ -5531,7 +5527,7 @@ SpellCastResult Spell::CheckRange(bool strict)
if(range_type == SPELL_RANGE_MELEE)
{
// Because of lag, we can not check too strictly here.
- if(!m_caster->IsWithinMeleeRange(target, max_range/* - 2*MIN_MELEE_REACH*/))
+ if(!m_caster->IsWithinMeleeRange(target, max_range))
return SPELL_FAILED_OUT_OF_RANGE;
}
else if(!m_caster->IsWithinCombatRange(target, max_range))