From b7b31df3af2d4d3119b5134e19a715d1f9f06c32 Mon Sep 17 00:00:00 2001 From: Sonny Jeon Date: Mon, 10 Dec 2012 19:17:22 -0700 Subject: [PATCH] Planner bug fix. - Oops! Misplace an if-then statement. Should work as advertised now. (Hopefully) --- planner.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/planner.c b/planner.c index a6e6148..b12dd20 100644 --- a/planner.c +++ b/planner.c @@ -222,15 +222,14 @@ static void planner_recalculate() next->recalculate_flag = true; } } - - // Recalculate if current block entry or exit junction speed has changed. - if (current->recalculate_flag || next->recalculate_flag) { - // NOTE: Entry and exit factors always > 0 by all previous logic operations. - calculate_trapezoid_for_block(current, current->entry_speed, next->entry_speed); - current->recalculate_flag = false; // Reset current only to ensure next trapezoid is computed - } } - + + // Recalculate if current block entry or exit junction speed has changed. + if (current->recalculate_flag || next->recalculate_flag) { + // NOTE: Entry and exit factors always > 0 by all previous logic operations. + calculate_trapezoid_for_block(current, current->entry_speed, next->entry_speed); + current->recalculate_flag = false; // Reset current only to ensure next trapezoid is computed + } } block_index = next_block_index( block_index ); }