diff options
author | Tim Segers <tsegers@pm.me> | 2022-12-22 15:57:39 +0100 |
---|---|---|
committer | Tim Segers <tsegers@pm.me> | 2022-12-22 15:57:39 +0100 |
commit | e60eef477ec88530e226357fbcd61590cce5feca (patch) | |
tree | 92daf9e86be573f6291a9f0dd765962673d296fd | |
parent | 4faf19f634028b07ae1be45d218616dc518680cb (diff) | |
download | opendeco-e60eef477ec88530e226357fbcd61590cce5feca.tar.gz |
Make sure first stop is not equal to current depth
Fixes: https://todo.sr.ht/~tsegers/opendeco/8
-rw-r--r-- | src/schedule.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/schedule.c b/src/schedule.c index f9d3dd4..56349fc 100644 --- a/src/schedule.c +++ b/src/schedule.c @@ -141,6 +141,10 @@ decoinfo_t calc_deco(decostate_t *ds, double start_depth, const gas_t *start_gas } double next_stop = abs_depth(ds->ceil_multiple * (ceil(gauge_depth(depth) / ds->ceil_multiple) - 1)); + + if (next_stop == depth) + next_stop -= ds->ceil_multiple; + double current_gf = get_gf(ds, next_stop); for (;;) { |