Round MOD of gas rather than truncate

For the proper calculation, we need to take salinity and surface pressure
into account (rather than depth = bar * 10 - 10)

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Robert C. Helling 2015-07-06 00:07:39 +02:00 committed by Dirk Hohndel
parent 9c6a3a7ff3
commit a7d18a9fa6
6 changed files with 24 additions and 12 deletions

View file

@ -226,7 +226,7 @@ void reset_cylinders(struct dive *dive, bool track_gas)
if (cylinder_none(cyl))
continue;
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));
cyl->depth = gas_mod(&cyl->gasmix, decopo2, dive, M_OR_FT(3,10));
if (track_gas)
cyl->start.mbar = cyl->end.mbar = cyl->type.workingpressure.mbar;
cyl->gas_used.mliter = 0;