feat(Core/Movement): port smooth waypoint movement from Cataclysm Preservation Project (#25106)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
Co-authored-by: Ovahlord <dreadkiller@gmx.de>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Kitzunu <Kitzunu@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-03-23 08:08:14 -05:00
committed by GitHub
parent 3da6e30196
commit 4201acddd5
69 changed files with 844 additions and 386 deletions

View File

@@ -388,6 +388,33 @@ void Creature::SearchFormation()
}
}
bool Creature::IsFormationLeader() const
{
if (!m_formation)
return false;
return m_formation->GetLeader() == this;
}
void Creature::SignalFormationMovement()
{
if (!m_formation)
return;
if (!m_formation->GetLeader() || m_formation->GetLeader() != this)
return;
m_formation->LeaderStartedMoving();
}
bool Creature::IsFormationLeaderMoveAllowed() const
{
if (!m_formation)
return true;
return m_formation->CanLeaderStartMoving();
}
void Creature::RemoveCorpse(bool setSpawnTime, bool skipVisibility)
{
if (getDeathState() != DeathState::Corpse)

View File

@@ -358,6 +358,14 @@ public:
[[nodiscard]] uint32 GetCurrentWaypointID() const { return m_waypointID; }
void UpdateWaypointID(uint32 wpID) { m_waypointID = wpID; }
// nodeId, pathId
std::pair<uint32, uint32> GetCurrentWaypointInfo() const { return _currentWaypointNodeInfo; }
void UpdateCurrentWaypointInfo(uint32 nodeId, uint32 pathId) { _currentWaypointNodeInfo = { nodeId, pathId }; }
bool IsFormationLeader() const;
void SignalFormationMovement();
bool IsFormationLeaderMoveAllowed() const;
void SearchFormation();
[[nodiscard]] CreatureGroup const* GetFormation() const { return m_formation; }
[[nodiscard]] CreatureGroup* GetFormation() { return m_formation; }
@@ -519,6 +527,7 @@ private:
// WaypointMovementGenerator variable
uint32 m_waypointID;
uint32 m_path_id;
std::pair<uint32, uint32> _currentWaypointNodeInfo{0, 0};
// Formation variable
CreatureGroup* m_formation;