diff options
author | Tim Segers <tsegers@pm.me> | 2022-10-12 16:04:51 +0200 |
---|---|---|
committer | Tim Segers <tsegers@pm.me> | 2022-10-12 16:05:56 +0200 |
commit | 879de8903e617d9e172a36045dc1b7b7ca4250c1 (patch) | |
tree | 82340b12e10ea7abb65d4c1eccf89b259f17a47a /src/deco.c | |
parent | 378ee4dbffb8c99ffe8a74bcce70e96851a3624a (diff) | |
download | opendeco-879de8903e617d9e172a36045dc1b7b7ca4250c1.tar.gz |
Add option to perform last deco stop at 6m instead of 3m
Diffstat (limited to 'src/deco.c')
-rw-r--r-- | src/deco.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -15,6 +15,8 @@ double P_WV = P_WV_DEFAULT; double PO2_MAX = PO2_MAX_DEFAULT; double END_MAX = END_MAX_DEFAULT; +int LAST_STOP_AT_SIX = LAST_STOP_AT_SIX_DEFAULT; + typedef struct zhl_n2_t { double t; double a[3]; @@ -213,7 +215,12 @@ double round_ceiling(const decostate_t *ds, const double c) { assert(ds->ceil_multiple != 0); - return abs_depth(ds->ceil_multiple * ceil(RND(gauge_depth(c) / ds->ceil_multiple))); + int numbered_stop = ceil(RND(gauge_depth(c) / ds->ceil_multiple)); + + if (numbered_stop == 1 && LAST_STOP_AT_SIX) + numbered_stop = 2; + + return abs_depth(ds->ceil_multiple * numbered_stop); } double ceiling(const decostate_t *ds, double gf) |