From 34a7e0645c7e5b0239ac39b8d7d27bebc32fb562 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 1 Aug 2026 00:36:20 +0200 Subject: [PATCH] Core/Units: Remove Unit::GetCurrentSpell(uint32) overload --- src/server/game/Entities/Unit/Unit.h | 1 - src/server/game/Spells/Auras/SpellAuraEffects.cpp | 12 ++++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 155f098b19..f9933f12d3 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1479,7 +1479,6 @@ class TC_GAME_API Unit : public WorldObject void InterruptNonMeleeSpells(bool withDelayed, uint32 spellid = 0, bool withInstant = true); Spell* GetCurrentSpell(CurrentSpellTypes spellType) const { return m_currentSpells[spellType]; } - Spell* GetCurrentSpell(uint32 spellType) const { return m_currentSpells[spellType]; } Spell* FindCurrentSpellBySpellId(uint32 spell_id) const; int32 GetCurrentSpellCastTime(uint32 spell_id) const; struct GetCastSpellInfoContext diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 7f3eda8ab4..4556bb34bd 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2367,14 +2367,10 @@ void AuraEffect::HandleFeignDeath(AuraApplication const* aurApp, uint8 mode, boo if (!isAffectedByFeignDeath(unit)) continue; - for (uint32 i = CURRENT_FIRST_NON_MELEE_SPELL; i < CURRENT_MAX_SPELL; i++) - { - if (unit->GetCurrentSpell(i) - && unit->GetCurrentSpell(i)->m_targets.GetUnitTargetGUID() == target->GetGUID()) - { - unit->InterruptSpell(CurrentSpellTypes(i), false); - } - } + for (CurrentSpellTypes i = CURRENT_GENERIC_SPELL; i < CURRENT_MAX_SPELL; i = CurrentSpellTypes(i + 1)) + if (Spell* currentSpell = unit->GetCurrentSpell(i)) + if (currentSpell->m_targets.GetUnitTargetGUID() == target->GetGUID()) + unit->InterruptSpell(i, false); } for (auto const& [guid, ref] : target->GetThreatManager().GetThreatenedByMeList())