Move blocks around

This commit is contained in:
David Markowitz 2023-08-10 02:09:58 -07:00
parent a3b62d60f0
commit fba8fc9c45

View File

@ -151,13 +151,17 @@ void MovementAIComponent::Update(const float deltaTime) {
// Check if there are more waypoints in the queue, if so set our next destination to the next waypoint // Check if there are more waypoints in the queue, if so set our next destination to the next waypoint
HandleWaypointArrived(); HandleWaypointArrived();
if (!AdvancePathWaypointIndex()) { if (!AdvancePathWaypointIndex()) {
if (m_Path && m_Path->pathBehavior == PathBehavior::Bounce) { if (m_Path) {
ReversePath(); if (m_Path->pathBehavior == PathBehavior::Bounce) {
} else if (m_Path && m_Path->pathBehavior == PathBehavior::Loop) { ReversePath();
m_CurrentPathWaypointIndex = 0; } else if (m_Path->pathBehavior == PathBehavior::Loop) {
m_NextPathWaypointIndex = 0; m_CurrentPathWaypointIndex = 0;
AdvancePathWaypointIndex(); m_NextPathWaypointIndex = 0;
SetDestination(GetCurrentPathWaypoint()); AdvancePathWaypointIndex();
SetDestination(GetCurrentPathWaypoint());
} else {
Stop();
}
} else { } else {
Stop(); Stop();
} }