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:
sogladev
2026-03-08 17:41:42 +01:00
committed by GitHub
parent 04fbeec3c2
commit 4f3e5ca591
19 changed files with 402 additions and 86 deletions

View File

@@ -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());

View File

@@ -1881,9 +1881,10 @@ public:
[[nodiscard]] bool IsInDisallowedMountForm() const;
// Followers
void addFollower(FollowerReference* pRef) { m_FollowingRefMgr.insertFirst(pRef); }
void removeFollower(FollowerReference* /*pRef*/) { /* nothing to do yet */ }
void AddFollower(FollowerReference* ref) { m_FollowingRefMgr.insertFirst(ref); }
[[nodiscard]] virtual float GetFollowAngle() const { return static_cast<float>(M_PI / 2); }
void RemoveFollower(FollowerReference* /*ref*/ ) { /* nothing to do yet */ }
void RemoveAllFollowers();
// Pets, guardians, minions...
[[nodiscard]] Guardian* GetGuardianPet() const;