refactor(Core/Movement): follower management of references (#25060)

Co-authored-by: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
sogladev 2026-03-12 10:59:16 +01:00 committed by GitHub
parent a8a96eb8f8
commit 40f55bb0f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 28 additions and 135 deletions

View file

@ -16,6 +16,7 @@
*/
#include "Unit.h"
#include "AbstractFollower.h"
#include "AreaDefines.h"
#include "ArenaSpectator.h"
#include "Battlefield.h"
@ -44,7 +45,6 @@
#include "MoveSpline.h"
#include "MoveSplineInit.h"
#include "MovementGenerator.h"
#include "AbstractFollower.h"
#include "ObjectAccessor.h"
#include "ObjectMgr.h"
#include "OutdoorPvP.h"
@ -5530,12 +5530,8 @@ void Unit::RemoveAreaAurasDueToLeaveWorld()
void Unit::RemoveAllFollowers()
{
while (auto* ref = m_FollowingRefMgr.getFirst())
{
auto* source = ref->GetSource();
ref->delink();
source->SetTarget(nullptr);
}
while (!m_followingMe.empty())
(*m_followingMe.begin())->SetTarget(nullptr);
}
void Unit::RemoveAllAuras()