mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
fix(Core/Spells): Fix iterator invalidation crash in deferred spell mod cleanup (#24974)
Co-authored-by: blinkysc <[email protected]>
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