mirror of
https://gitcode.com/GitHub_Trending/az/azerothcore-wotlk.git
synced 2026-10-10 07:06:38 +08:00
fix(Core/Unit): cancel pending events before aura cleanup on map removal (#27527)
Co-authored-by: bashermens <[email protected]> Co-authored-by: sudlud <[email protected]>
This commit is contained in:
co-authored by
bashermens
sudlud
parent
18f28bd144
commit
2b5ddea71d
@@ -12612,6 +12612,10 @@ void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup)
|
||||
if (IsInWorld()) // not in world and not being removed atm
|
||||
RemoveFromWorld();
|
||||
|
||||
// Abort pending events here: left to ~EventProcessor they run after m_spellMods is already
|
||||
// destroyed, and cancelling a SpellEvent then hits freed memory in Player::RestoreSpellMods.
|
||||
m_Events.KillAllEvents(false);
|
||||
|
||||
ASSERT(GetGUID());
|
||||
|
||||
// A unit may be in removelist and not in world, but it is still in grid
|
||||
|
||||
Reference in New Issue
Block a user