diff options
author | megamage <none@none> | 2009-06-15 12:02:55 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-06-15 12:02:55 -0500 |
commit | b9610f27dd2c55f63f9a96f1259a8dce33b71d88 (patch) | |
tree | 4920b011dc839e2c4901e31d8996a206bff63808 /src/game/Spell.cpp | |
parent | 4d6fb6c8b2d84996711fa8bc41e71fa6d483b98c (diff) |
*Check movementflag to interrupt casting instead of checking position.
*Also some other fixes about movement flags.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Spell.cpp')
-rw-r--r-- | src/game/Spell.cpp | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 0f2def62271..645c2529433 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -423,7 +423,6 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi m_spellState = SPELL_STATE_NULL; - m_castPositionX = m_castPositionY = m_castPositionZ = 0; m_TriggerSpells.clear(); m_IsTriggeredSpell = triggered; //m_AreaAura = false; @@ -2391,9 +2390,6 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect* triggeredByAura m_spellState = SPELL_STATE_PREPARING; - m_caster->GetPosition(m_castPositionX, m_castPositionY, m_castPositionZ); - m_castOrientation = m_caster->GetOrientation(); - if(triggeredByAura) m_triggeredByAuraSpell = triggeredByAura->GetSpellProto(); @@ -2920,15 +2916,11 @@ void Spell::update(uint32 difftime) // check if the player caster has moved before the spell finished if ((m_caster->GetTypeId() == TYPEID_PLAYER && m_timer != 0) && - (m_castPositionX != m_caster->GetPositionX() || m_castPositionY != m_caster->GetPositionY() || m_castPositionZ != m_caster->GetPositionZ()) && + m_caster->isMoving() && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) && (m_spellInfo->Effect[0] != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING))) { - // always cancel for channeled spells - //if( m_spellState == SPELL_STATE_CASTING ) - // cancel(); // don't cancel for melee, autorepeat, triggered and instant spells - //else - if(!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !m_IsTriggeredSpell && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT)) + if(!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !m_IsTriggeredSpell) cancel(); } @@ -2951,17 +2943,6 @@ void Spell::update(uint32 difftime) { if(m_timer > 0) { - if( m_caster->GetTypeId() == TYPEID_PLAYER ) - { - // check if player has jumped before the channeling finished - if(m_caster->HasUnitMovementFlag(MOVEMENTFLAG_JUMPING)) - cancel(); - - // check for incapacitating player states - //if( m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_CONFUSED)) - // cancel(); - } - // check if there are alive targets left if (!UpdateChanneledTargetList()) { |