aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Tim Segers <tsegers@pm.me>2022-12-22 15:57:39 +0100
committerGravatar Tim Segers <tsegers@pm.me>2022-12-22 15:57:39 +0100
commite60eef477ec88530e226357fbcd61590cce5feca (patch)
tree92daf9e86be573f6291a9f0dd765962673d296fd /src
parent4faf19f634028b07ae1be45d218616dc518680cb (diff)
downloadopendeco-e60eef477ec88530e226357fbcd61590cce5feca.tar.gz
Make sure first stop is not equal to current depth
Fixes: https://todo.sr.ht/~tsegers/opendeco/8
Diffstat (limited to 'src')
-rw-r--r--src/schedule.c4
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 (;;) {