summaryrefslogtreecommitdiffstats
path: root/equipment.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-04 11:40:02 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-04 11:40:02 -0700
commitcc86d68c86110bb16b5a75dbd50d35dca39c0719 (patch)
tree30d900cfdc85685b7c9d975b626e281222e1a092 /equipment.c
parentd4e37453704edf433a28f457d25c608d8eac1bd3 (diff)
downloadsubsurface-cc86d68c86110bb16b5a75dbd50d35dca39c0719.tar.gz
Planner: don't set cylinder start and end pressure when adding dive
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'equipment.c')
-rw-r--r--equipment.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/equipment.c b/equipment.c
index 0cc7ea918..438bca02a 100644
--- a/equipment.c
+++ b/equipment.c
@@ -231,8 +231,8 @@ void remove_weightsystem(struct dive *dive, int idx)
}
/* when planning a dive we need to make sure that all cylinders have a sane depth assigned
- * and that the pressures are reset to start = end = workingpressure */
-void reset_cylinders(struct dive *dive)
+ * and if we are tracking gas consumption the pressures need to be reset to start = end = workingpressure */
+void reset_cylinders(struct dive *dive, bool track_gas)
{
int i;
pressure_t pO2 = {.mbar = 1400};
@@ -243,7 +243,7 @@ void reset_cylinders(struct dive *dive)
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->type.workingpressure.mbar)
+ if (track_gas && cyl->type.workingpressure.mbar)
cyl->start.mbar = cyl->end.mbar = cyl->type.workingpressure.mbar;
cyl->gas_used.mliter = 0;
}