From 8e1ea8cd144ee216dae1aca2d016118d83a0d8bb Mon Sep 17 00:00:00 2001 From: Rick Walsh Date: Fri, 3 Nov 2017 08:01:52 +1100 Subject: VPMB profile: remember deco_time when restoring deco_state Otherwise the CVA won't iterate properly. Signed-off-by: Rick Walsh --- core/profile.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/profile.c b/core/profile.c index d7f110db3..631aaa8b8 100644 --- a/core/profile.c +++ b/core/profile.c @@ -1077,6 +1077,7 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru } } if (decoMode() == VPMB && !in_planner()) { + int this_deco_time; prev_deco_time = deco_state->deco_time; // Do we need to update deco_time? if (final_tts > 0) @@ -1093,7 +1094,9 @@ void calculate_deco_information(struct dive *dive, struct divecomputer *dc, stru first_ceiling = 0; first_iteration = false; count_iteration ++; + this_deco_time = deco_state->deco_time; restore_deco_state(cache_data_initial, true); + deco_state->deco_time = this_deco_time; } else { // With Buhlmann iterating isn't needed. This makes the while condition false. prev_deco_time = deco_state->deco_time = 0; -- cgit v1.2.3-70-g09d2