From 5e8534767c66ca492bab929d91f2d86d18dd9aba Mon Sep 17 00:00:00 2001 From: Aqua Deus <95978183+aquadeus@users.noreply.github.com> Date: Wed, 8 Jun 2022 20:40:35 +0200 Subject: Core/PacketIO: Implement CMSG_CANCEL_MOD_SPEED_NO_CONTROL_AURAS (#27975) Co-authored-by: Shauren --- src/server/game/Handlers/SpellHandler.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/server/game/Handlers/SpellHandler.cpp') diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 1de96660fc5..a189a8022b1 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -450,6 +450,19 @@ void WorldSession::HandleCancelMountAuraOpcode(WorldPackets::Spells::CancelMount }); } +void WorldSession::HandleCancelModSpeedNoControlAuras(WorldPackets::Spells::CancelModSpeedNoControlAuras& cancelModSpeedNoControlAuras) +{ + Unit* mover = _player->GetUnitBeingMoved(); + if (!mover || mover->GetGUID() != cancelModSpeedNoControlAuras.TargetGUID) + return; + + _player->RemoveAurasByType(SPELL_AURA_MOD_SPEED_NO_CONTROL, [](AuraApplication const* aurApp) + { + SpellInfo const* spellInfo = aurApp->GetBase()->GetSpellInfo(); + return !spellInfo->HasAttribute(SPELL_ATTR0_NO_AURA_CANCEL) && spellInfo->IsPositive() && !spellInfo->IsPassive(); + }); +} + void WorldSession::HandleCancelAutoRepeatSpellOpcode(WorldPackets::Spells::CancelAutoRepeatSpell& /*cancelAutoRepeatSpell*/) { // may be better send SMSG_CANCEL_AUTO_REPEAT? -- cgit v1.2.3