diff options
Diffstat (limited to 'src/schedule.c')
-rw-r--r-- | src/schedule.c | 4 |
1 files 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); |