mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-16 05:55:07 +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());
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user