planner: pass in_planner argument to vpmb_next_gradient()

To remove reliance on global state, pass an "in_planner" argument
to vpmb_next_gradient(). Thus, calls to in_planner() can be removed.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-02-12 17:47:52 +01:00 committed by Dirk Hohndel
parent 93ecad1b04
commit 8103e947aa
4 changed files with 9 additions and 9 deletions

View file

@ -849,7 +849,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i
decostopcounter = 0;
is_final_plan = (decoMode() == BUEHLMANN) || (previous_deco_time - ds->deco_time < 10); // CVA time converges
if (ds->deco_time != 10000000)
vpmb_next_gradient(ds, ds->deco_time, diveplan->surface_pressure / 1000.0);
vpmb_next_gradient(ds, ds->deco_time, diveplan->surface_pressure / 1000.0, true);
previous_deco_time = ds->deco_time;
restore_deco_state(bottom_cache, ds, true);