diff options
author | Anton Lundin <glance@acc.umu.se> | 2014-12-04 20:56:17 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-12-04 16:27:27 -0600 |
commit | 236b1d08ed2fe9fbc30055e06736a61d7aaa4e84 (patch) | |
tree | 82679dd4fa572470699dc6248d34133254e37155 /equipment.c | |
parent | 7bc5a62ca1e5b80fbfdcfe33e351d553cb388d97 (diff) | |
download | subsurface-236b1d08ed2fe9fbc30055e06736a61d7aaa4e84.tar.gz |
When (re)planning use prefs.decopo2 for mod
Use our the decopo2 from preferences for mod/switchdepth calculations
when re-planning a dive or planning a dive based on a previous dive.
Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'equipment.c')
-rw-r--r-- | equipment.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/equipment.c b/equipment.c index 6396df0ca..32f77742b 100644 --- a/equipment.c +++ b/equipment.c @@ -215,14 +215,14 @@ void remove_weightsystem(struct dive *dive, int idx) void reset_cylinders(struct dive *dive, bool track_gas) { int i; - pressure_t pO2 = {.mbar = 1400}; + pressure_t decopo2 = {.mbar = prefs.decopo2}; for (i = 0; i < MAX_CYLINDERS; i++) { cylinder_t *cyl = &dive->cylinder[i]; if (cylinder_none(cyl)) continue; - if (cyl->depth.mm == 0) /* if the gas doesn't give a mod, assume conservative pO2 */ - cyl->depth = gas_mod(&cyl->gasmix, pO2, M_OR_FT(3,10)); + if (cyl->depth.mm == 0) /* if the gas doesn't give a mod, calculate based on prefs */ + cyl->depth = gas_mod(&cyl->gasmix, decopo2, M_OR_FT(3,10)); if (track_gas) cyl->start.mbar = cyl->end.mbar = cyl->type.workingpressure.mbar; cyl->gas_used.mliter = 0; |