mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-15 21:45:12 +00:00
fix(Core/Movement): add creature formation movement generator (#25030)
Co-authored-by: Shauren <shauren.trinity@gmail.com> Co-authored-by: Rocco Silipo <108557877+Rorschach91@users.noreply.github.com>
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "MovementGenerator.h"
|
||||
#include "AbstractFollower.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "OutdoorPvP.h"
|
||||
@@ -5528,6 +5529,16 @@ void Unit::RemoveAreaAurasDueToLeaveWorld()
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveAllFollowers()
|
||||
{
|
||||
while (auto* ref = m_FollowingRefMgr.getFirst())
|
||||
{
|
||||
auto* source = ref->GetSource();
|
||||
ref->delink();
|
||||
source->SetTarget(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::RemoveAllAuras()
|
||||
{
|
||||
// this may be a dead loop if some events on aura remove will continiously apply aura on remove
|
||||
@@ -12700,6 +12711,8 @@ void Unit::RemoveFromWorld()
|
||||
|
||||
RemoveAreaAurasDueToLeaveWorld();
|
||||
|
||||
RemoveAllFollowers();
|
||||
|
||||
if (GetCharmerGUID())
|
||||
{
|
||||
LOG_FATAL("entities.unit", "Unit {} has charmer guid when removed from world", GetEntry());
|
||||
|
||||
Reference in New Issue
Block a user