diff options
author | Rick Walsh <rickmwalsh@gmail.com> | 2017-11-03 08:01:52 +1100 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2017-11-08 15:22:32 +0100 |
commit | 8e1ea8cd144ee216dae1aca2d016118d83a0d8bb (patch) | |
tree | 38c4848eaf11f6312950469d52fb94e8140affd8 | |
parent | b3b787db9430ca6d974a167d23b2ffa1ad3d2b2a (diff) | |
download | subsurface-8e1ea8cd144ee216dae1aca2d016118d83a0d8bb.tar.gz |
VPMB profile: remember deco_time when restoring deco_state
Otherwise the CVA won't iterate properly.
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
-rw-r--r-- | core/profile.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |