mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-08 02:00:29 +00:00
fix(Core/Spells): Fix iterator invalidation crash in deferred spell mod cleanup (#24974)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
@@ -3992,7 +3992,9 @@ void Spell::_cast(bool skipCheck)
|
||||
handle_immediate();
|
||||
|
||||
// Clean up deferred 0-charge spell modifier auras
|
||||
for (Aura* aura : m_appliedMods)
|
||||
// Copy to vector first — aura->Remove() can modify m_appliedMods
|
||||
std::vector<Aura*> appliedModsCopy(m_appliedMods.begin(), m_appliedMods.end());
|
||||
for (Aura* aura : appliedModsCopy)
|
||||
{
|
||||
if (!aura->IsRemoved() && aura->IsUsingCharges()
|
||||
&& !aura->GetCharges())
|
||||
|
||||
Reference in New Issue
Block a user