From 5a55cb9522919ce7cae9b451d5407df9583bb48d Mon Sep 17 00:00:00 2001 From: Kitzunu <24550914+Kitzunu@users.noreply.github.com> Date: Sun, 2 Apr 2023 20:36:13 +0200 Subject: [PATCH] =?UTF-8?q?fix(Core/Spell):=20Remove=20channeled=20auras?= =?UTF-8?q?=20when=20caster=20and=20target=20are=20no=E2=80=A6=20(#15419)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix(Core/Spell): Remove channeled auras when caster and target are not on the same map * Chery-pick commit (https://github.com/TrinityCore/TrinityCore/commit/d23c839998263330aa475125e0bca16dd8fe51bb) Co-authored-by: Shauren --- src/server/game/Entities/Unit/Unit.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 44ca8c5e8..126d3a7b9 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -3822,6 +3822,8 @@ void Unit::_UpdateSpells(uint32 time) { if (i->second->IsExpired()) RemoveOwnedAura(i, AURA_REMOVE_BY_EXPIRE); + else if (i->second->GetSpellInfo()->IsChanneled() && i->second->GetCasterGUID() != GetGUID() && !ObjectAccessor::GetWorldObject(*this, i->second->GetCasterGUID())) + RemoveOwnedAura(i, AURA_REMOVE_BY_CANCEL); // remove channeled auras when caster is not on the same map else ++i; }