diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-07-04 11:40:02 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-07-04 11:40:02 -0700 |
commit | cc86d68c86110bb16b5a75dbd50d35dca39c0719 (patch) | |
tree | 30d900cfdc85685b7c9d975b626e281222e1a092 /equipment.c | |
parent | d4e37453704edf433a28f457d25c608d8eac1bd3 (diff) | |
download | subsurface-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.c | 6 |
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; } |