fix path starting waypoint

This commit is contained in:
Aaron Kimbre 2023-08-15 09:47:45 -05:00
parent 92e2ab55d9
commit 5168404567
3 changed files with 3 additions and 10 deletions

View File

@ -48,7 +48,7 @@ MovementAIComponent::MovementAIComponent(Entity* parent, MovementAIInfo info) :
m_TimeTravelled = 0; m_TimeTravelled = 0;
m_CurrentSpeed = 0; m_CurrentSpeed = 0;
m_MaxSpeed = 0; m_MaxSpeed = 0;
m_StartingWaypointIndex = 0; m_StartingWaypointIndex = -1;
m_CurrentPathWaypointIndex = 0; m_CurrentPathWaypointIndex = 0;
m_LockRotation = false; m_LockRotation = false;
m_IsInReverse = false; m_IsInReverse = false;

View File

@ -228,10 +228,6 @@ public:
static float GetBaseSpeed(LOT lot); static float GetBaseSpeed(LOT lot);
private: private:
// TODO: Advance properly
void SetCurrentPathWaypointIndex(uint32_t value) { };
void SetNextPathWaypointIndex(uint32_t value) { };
float HandleWaypointCommandGroupEmote(const std::string& data); float HandleWaypointCommandGroupEmote(const std::string& data);
void HandleWaypointCommandSetVariable(const std::string& data); void HandleWaypointCommandSetVariable(const std::string& data);
void HandleWaypointCommandCastSkill(const std::string& data); void HandleWaypointCommandCastSkill(const std::string& data);

View File

@ -83,8 +83,7 @@ void MovementAIComponent::HandleWaypointArrived(uint32_t commandIndex) {
} }
m_Parent->AddCallbackTimer(delay, [this, commandIndex](){ m_Parent->AddCallbackTimer(delay, [this, commandIndex](){
auto newCommandIndex = commandIndex + 1; this->HandleWaypointArrived(commandIndex + 1);
this->HandleWaypointArrived(newCommandIndex);
} }
); );
} }
@ -205,10 +204,8 @@ void MovementAIComponent::HandleWaypointCommandChangeWaypoint(const std::string&
} else path_string = data; } else path_string = data;
if (path_string != "") { if (path_string != "") {
SetPathStartingWaypointIndex(index);
SetupPath(path_string); SetupPath(path_string);
// TODO: do better? talk to emo
SetCurrentPathWaypointIndex(index);
SetNextPathWaypointIndex(index);
} }
} }