summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
authorGravatar Rick Walsh <rickmwalsh@gmail.com>2015-09-17 07:18:16 +1000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-09-16 21:16:58 -0700
commit3d8e5b638ad4c1fbb43f6dd5f535bf0b33a51f0b (patch)
treef81f9d3d7c8d27b3e61a199601b2e5a81424082c /planner.c
parent95720e94eee79abd64dcc16969ad6b91d7c1ae50 (diff)
downloadsubsurface-3d8e5b638ad4c1fbb43f6dd5f535bf0b33a51f0b.tar.gz
VPM-B restore deco state before calculating next gradient
The next gradient calculation at the start of the CVA loop should be performed using the tissue loading before starting the iterations, rather than the loading at the end of the previous iteration. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/planner.c b/planner.c
index 7bd76ce78..1326f69dd 100644
--- a/planner.c
+++ b/planner.c
@@ -1142,11 +1142,11 @@ bool plan(struct diveplan *diveplan, char **cached_datap, bool is_planner, bool
//CVA
do {
is_final_plan = (prefs.deco_mode == BUEHLMANN) || (previous_deco_time - deco_time < 10); // CVA time converges
+ restore_deco_state(bottom_cache);
if (deco_time != 10000000)
vpmb_next_gradient(deco_time, diveplan->surface_pressure / 1000.0);
previous_deco_time = deco_time;
- restore_deco_state(bottom_cache);
depth = bottom_depth;
gi = bottom_gi;