*Check range for channeled spells during their duration.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-02-16 17:09:26 +01:00
parent bb75ff7b79
commit 0e282daccc
3 changed files with 7 additions and 13 deletions
+5 -2
View File
@@ -2108,7 +2108,7 @@ void Spell::prepare(SpellCastTargets * targets, Aura* triggeredByAura)
} }
} }
void Spell::cancel(bool report) void Spell::cancel()
{ {
if(m_spellState == SPELL_STATE_FINISHED) if(m_spellState == SPELL_STATE_FINISHED)
return; return;
@@ -2138,7 +2138,7 @@ void Spell::cancel(bool report)
m_caster->RemoveAurasDueToCasterSpell(m_spellInfo->Id, m_caster->GetGUID()); m_caster->RemoveAurasDueToCasterSpell(m_spellInfo->Id, m_caster->GetGUID());
SendChannelUpdate(0); SendChannelUpdate(0);
SendInterrupted(0); SendInterrupted(0);
SendCastResult(report ? SPELL_FAILED_INTERRUPTED : SPELL_FAILED_DONT_REPORT); SendCastResult(SPELL_FAILED_INTERRUPTED);
} break; } break;
default: default:
@@ -5248,6 +5248,9 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time)
// another non-melee non-delayed spell is casted now, abort // another non-melee non-delayed spell is casted now, abort
m_Spell->cancel(); m_Spell->cancel();
} }
// Check if target of channeled spell still in range
else if (m_Spell->CheckRange(false))
m_Spell->cancel();
else else
{ {
// do the action (pass spell to channeling state) // do the action (pass spell to channeling state)
+1 -1
View File
@@ -324,7 +324,7 @@ class Spell
~Spell(); ~Spell();
void prepare(SpellCastTargets * targets, Aura* triggeredByAura = NULL); void prepare(SpellCastTargets * targets, Aura* triggeredByAura = NULL);
void cancel(bool report = true); void cancel();
void update(uint32 difftime); void update(uint32 difftime);
void cast(bool skipCheck = false); void cast(bool skipCheck = false);
void finish(bool ok = true); void finish(bool ok = true);
+1 -10
View File
@@ -4692,8 +4692,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
&& AurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()]!= SPELL_AURA_DUMMY) && AurSpellInfo->EffectApplyAuraName[Aur->GetEffIndex()]!= SPELL_AURA_DUMMY)
//don't stop channeling of scripted spells (this is actually a hack) //don't stop channeling of scripted spells (this is actually a hack)
{ {
caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel(false); caster->m_currentSpells[CURRENT_CHANNELED_SPELL]->cancel();
channeled = true;
} }
} }
} }
@@ -4733,14 +4732,6 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
delete Aur; delete Aur;
if(channeled)
{
//if target is not caster remove auras also on caster
if (caster!=this)
caster->RemoveAurasAtChanneledTarget (AurSpellInfo, caster);
RemoveAurasAtChanneledTarget (AurSpellInfo, caster);
}
if(statue) if(statue)
statue->UnSummon(); statue->UnSummon();