diff --git a/dGame/dComponents/MovementAIComponent.cpp b/dGame/dComponents/MovementAIComponent.cpp index 88372251..12927506 100644 --- a/dGame/dComponents/MovementAIComponent.cpp +++ b/dGame/dComponents/MovementAIComponent.cpp @@ -48,7 +48,7 @@ MovementAIComponent::MovementAIComponent(Entity* parent, MovementAIInfo info) : m_TimeTravelled = 0; m_CurrentSpeed = 0; m_MaxSpeed = 0; - m_StartingWaypointIndex = 0; + m_StartingWaypointIndex = -1; m_CurrentPathWaypointIndex = 0; m_LockRotation = false; m_IsInReverse = false; diff --git a/dGame/dComponents/MovementAIComponent.h b/dGame/dComponents/MovementAIComponent.h index 8e1ae878..d6c25844 100644 --- a/dGame/dComponents/MovementAIComponent.h +++ b/dGame/dComponents/MovementAIComponent.h @@ -228,10 +228,6 @@ public: static float GetBaseSpeed(LOT lot); private: - - // TODO: Advance properly - void SetCurrentPathWaypointIndex(uint32_t value) { }; - void SetNextPathWaypointIndex(uint32_t value) { }; float HandleWaypointCommandGroupEmote(const std::string& data); void HandleWaypointCommandSetVariable(const std::string& data); void HandleWaypointCommandCastSkill(const std::string& data); diff --git a/dGame/dComponents/MovementAIComponentAronwk.cpp b/dGame/dComponents/MovementAIComponentAronwk.cpp index f1566390..2de24a07 100644 --- a/dGame/dComponents/MovementAIComponentAronwk.cpp +++ b/dGame/dComponents/MovementAIComponentAronwk.cpp @@ -83,8 +83,7 @@ void MovementAIComponent::HandleWaypointArrived(uint32_t commandIndex) { } m_Parent->AddCallbackTimer(delay, [this, commandIndex](){ - auto newCommandIndex = commandIndex + 1; - this->HandleWaypointArrived(newCommandIndex); + this->HandleWaypointArrived(commandIndex + 1); } ); } @@ -205,10 +204,8 @@ void MovementAIComponent::HandleWaypointCommandChangeWaypoint(const std::string& } else path_string = data; if (path_string != "") { + SetPathStartingWaypointIndex(index); SetupPath(path_string); - // TODO: do better? talk to emo - SetCurrentPathWaypointIndex(index); - SetNextPathWaypointIndex(index); } }