Looking4Group / L4G_Core

Looking4Group Core
http://looking4group.eu
GNU General Public License v2.0
37 stars 69 forks source link

Casting while moving #1547

Open Xadras opened 8 years ago

Xadras commented 8 years ago

Originally reported by: Evolve (Bitbucket: Evolveuwotm9, GitHub: Unknown)


You are able to start casting while moving, this shouldnt be possible.


Xadras commented 8 years ago

Original comment by Evolve (Bitbucket: Evolveuwotm9, GitHub: Unknown):


https://github.com/TrinityCore/TrinityCore/blob/4.3.4/src/server/game/Spells/Spell.cpp#L2940

there was a fix but it seems it doesnt exist anymore xd but it is for sure public, you just need to search for it and copy paste it...

you just have to change the last conditions that are not supposed to be on TBC and the rest you have to re-write based on your core

// don't allow channeled spells / spells with cast time to be cast while moving // (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in) // don't cancel spells which are affected by a SPELL_AURA_CAST_WHILE_WALKING effect if (((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->isMoving() && m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT) && !m_caster->HasAuraTypeWithAffectMask(SPELL_AURA_CAST_WHILE_WALKING, m_spellInfo)) { SendCastResult(SPELL_FAILED_MOVING); finish(false); return; }