From 199c73cf75ab4f01fff91dbfffe7eb951a02e295 Mon Sep 17 00:00:00 2001 From: Aaron Kimbre Date: Sat, 12 Nov 2022 15:01:15 -0600 Subject: [PATCH] the go zoom --- dGame/dComponents/MovementAIComponent.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dGame/dComponents/MovementAIComponent.cpp b/dGame/dComponents/MovementAIComponent.cpp index ed450f9d..81d49af7 100644 --- a/dGame/dComponents/MovementAIComponent.cpp +++ b/dGame/dComponents/MovementAIComponent.cpp @@ -75,7 +75,7 @@ void MovementAIComponent::Update(const float deltaTime) { return; } } - Game::logger->Log("MovementAIComponent", "timer %f", m_Timer); + // Game::logger->Log("MovementAIComponent", "timer %f", m_Timer); if (m_Timer > 0) { m_Timer -= deltaTime; @@ -194,6 +194,8 @@ NiPoint3 MovementAIComponent::GetCurrentWaypoint() const { } void MovementAIComponent::ArrivedAtPathWaypoint(){ + if(!m_MovementPath) return; + if (m_PathIndex >= m_CurrentPath.size()) return; // TODO: Call scripts here PathWaypoint waypoint = m_MovementPath->pathWaypoints.at(m_PathIndex); @@ -362,7 +364,7 @@ void MovementAIComponent::SetMovementPath(Path* movementPath){ std::vector pathWaypoints; for (const auto& waypoint : movementPath->pathWaypoints) m_CurrentPath.push_back(waypoint.position); SetSpeed(m_BaseSpeed); - m_PathIndex = 0; + m_PathIndex = m_Parent->GetVarAs(u"attached_path_start"); m_TotalTime = m_Timer = 0;