mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
Core/Movement: moved the cleanup of the idle motion slot to CleanupBeforeRemoveFromMap
This commit is contained in:
@@ -10449,8 +10449,6 @@ void Unit::RemoveFromWorld()
|
||||
|
||||
RemoveAreaAurasDueToLeaveWorld();
|
||||
|
||||
GetMotionMaster()->Clear(MOTION_SLOT_IDLE); // clear idle movement slot to finalize follow movement to unregister formation targets
|
||||
|
||||
if (GetCharmerGUID())
|
||||
{
|
||||
TC_LOG_FATAL("entities.unit", "Unit %u has charmer guid when removed from world", GetEntry());
|
||||
@@ -10476,6 +10474,9 @@ void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup)
|
||||
// This needs to be before RemoveFromWorld to make GetCaster() return a valid pointer on aura removal
|
||||
InterruptNonMeleeSpells(true);
|
||||
|
||||
// clear idle movement slot to finalize follow movement to unregister formation targets
|
||||
GetMotionMaster()->Clear(MOTION_SLOT_IDLE);
|
||||
|
||||
if (IsInWorld())
|
||||
RemoveFromWorld();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user