From 8dae03b00b8a24b690214a79af057b8d0de83cd0 Mon Sep 17 00:00:00 2001 From: Tim Segers Date: Sun, 9 Jul 2023 18:59:20 +0200 Subject: Tweak first stop calculation procedure --- src/schedule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/schedule.c b/src/schedule.c index b2c50c1..7fbfaf5 100644 --- a/src/schedule.c +++ b/src/schedule.c @@ -139,9 +139,9 @@ decoinfo_t calc_deco(decostate_t *ds, const gas_t *deco_gasses, int nof_gasses, return (decoinfo_t){.tts = 0, .ndl = calc_ndl(ds, asc_per_min)}; /* prepare for the first stop */ - next_stop = abs_depth(ds->ceil_multiple * (ceil(gauge_depth(ds->depth) / ds->ceil_multiple) - 1)); + next_stop = abs_depth(ds->ceil_multiple * (ceil(gauge_depth(ds->depth) / ds->ceil_multiple))); - if (next_stop == ds->depth) + while (next_stop >= ds->depth) next_stop -= ds->ceil_multiple; current_gf = get_gf(ds, next_stop); -- cgit v1.2.3-70-g09d2