From 236b1d08ed2fe9fbc30055e06736a61d7aaa4e84 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Thu, 4 Dec 2014 20:56:17 +0100 Subject: 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 Signed-off-by: Dirk Hohndel --- equipment.c | 6 +++--- 1 file 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; -- cgit v1.2.3-70-g09d2