diff options
-rw-r--r-- | core/planner.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/planner.c b/core/planner.c index 6632c76a4..c18dd8553 100644 --- a/core/planner.c +++ b/core/planner.c @@ -1060,7 +1060,7 @@ bool plan(struct diveplan *diveplan, struct dive *dive, int timestep, struct dec * otherwise odd things can happen, such as CVA causing the final ascent to start *later* * if the ascent rate is slower, which is completely nonsensical. * Assume final ascent takes 20s, which is the time taken to ascend at 9m/min from 3m */ - deco_state->deco_time = clock - bottom_time - stoplevels[2] / last_ascend_rate + 20; + deco_state->deco_time = clock - bottom_time - stoplevels[stopidx + 1] / last_ascend_rate + 20; } while (!is_final_plan); decostoptable[decostopcounter].depth = 0; |