[10189] Fix display of Interrupted message and fix channelled spells interrupting

This commit is contained in:
Laise 2010-07-14 13:22:32 +03:00
parent eadeda8f5d
commit 904ef55b4e
4 changed files with 20 additions and 23 deletions

View file

@ -2676,6 +2676,9 @@ void Spell::cancel()
if(m_spellState == SPELL_STATE_FINISHED)
return;
// channeled spells don't display interrupted message even if they are interrupted, possible other cases with no "Interrupted" message
bool sendInterrupt = IsChanneledSpell(m_spellInfo) ? false : true;
m_autoRepeat = false;
switch (m_spellState)
{
@ -2683,6 +2686,8 @@ void Spell::cancel()
case SPELL_STATE_DELAYED:
{
SendInterrupted(0);
if (sendInterrupt)
SendCastResult(SPELL_FAILED_INTERRUPTED);
} break;
@ -2700,6 +2705,8 @@ void Spell::cancel()
SendChannelUpdate(0);
SendInterrupted(0);
if (sendInterrupt)
SendCastResult(SPELL_FAILED_INTERRUPTED);
} break;

View file

@ -888,10 +888,12 @@ void Aura::ApplyModifier(bool apply, bool Real)
{
AuraType aura = m_modifier.m_auraname;
GetHolder()->SetInUse(true);
SetInUse(true);
if(aura < TOTAL_AURAS)
(*this.*AuraHandler [aura])(apply, Real);
SetInUse(false);
GetHolder()->SetInUse(false);
}
bool Aura::isAffectedOnSpell(SpellEntry const *spell) const
@ -2195,18 +2197,6 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
return;
}
if (m_removeMode == AURA_REMOVE_BY_DEATH)
{
// Stop caster Arcane Missle chanelling on death
if (GetSpellProto()->SpellFamilyName == SPELLFAMILY_MAGE && (GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000800)))
{
if (Unit* caster = GetCaster())
caster->InterruptSpell(CURRENT_CHANNELED_SPELL);
return;
}
}
}
// AT APPLY & REMOVE
@ -3362,7 +3352,6 @@ void Aura::HandleModPossess(bool apply, bool Real)
}
else
{
p_caster->InterruptSpell(CURRENT_CHANNELED_SPELL); // the spell is not automatically canceled when interrupted, do it now
p_caster->SetCharm(NULL);
camera.ResetView();
@ -7685,14 +7674,12 @@ void SpellAuraHolder::RemoveAura(SpellEffectIndex index)
void SpellAuraHolder::ApplyAuraModifiers(bool apply, bool real)
{
SetInUse(true);
for (int32 i = 0; i < MAX_EFFECT_INDEX; ++i)
{
Aura *aur = GetAuraByEffectIndex(SpellEffectIndex(i));
if (aur)
aur->ApplyModifier(apply, real);
}
SetInUse(false);
}
void SpellAuraHolder::_AddSpellAuraHolder()
@ -8725,7 +8712,7 @@ void SpellAuraHolder::Update(uint32 diff)
if(!caster->IsWithinDistInMap(m_target, max_range))
{
m_target->RemoveAurasByCasterSpell(GetId(), GetCasterGUID());
caster->InterruptSpell(CURRENT_CHANNELED_SPELL);
return;
}
}

View file

@ -4518,8 +4518,8 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode)
// Statue unsummoned at holder remove
SpellEntry const* AurSpellInfo = holder->GetSpellProto();
Totem* statue = NULL;
if(IsChanneledSpell(AurSpellInfo))
if(Unit* caster = holder->GetCaster())
Unit* caster = holder->GetCaster();
if(IsChanneledSpell(AurSpellInfo) && caster)
if(caster->GetTypeId()==TYPEID_UNIT && ((Creature*)caster)->isTotem() && ((Totem*)caster)->GetTotemType()==TOTEM_STATUE)
statue = ((Totem*)caster);
@ -4559,6 +4559,9 @@ void Unit::RemoveSpellAuraHolder(SpellAuraHolder *holder, AuraRemoveMode mode)
m_deletedHolders.push_back(holder);
else
delete holder;
if (IsChanneledSpell(AurSpellInfo) && caster && caster->GetGUID() != GetGUID())
caster->InterruptSpell(CURRENT_CHANNELED_SPELL);
}
void Unit::RemoveSingleAuraFromSpellAuraHolder(SpellAuraHolder *holder, SpellEffectIndex index, AuraRemoveMode mode)

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "10019"
#define REVISION_NR "10189"
#endif // __REVISION_NR_H__