summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-08 12:20:35 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-01-08 12:20:35 -0800
commit8b24784a7a5886b23815f9b4657400596f1fe274 (patch)
tree6d32aff9edf4f935ae01bea52f77347a80523154
parentd864f5cdfaf149e46ac6d068e99575b31b2cc885 (diff)
downloadsubsurface-8b24784a7a5886b23815f9b4657400596f1fe274.tar.gz
Fix deco display bug for dives with multiple samples at the same time
While one might argue that multiple samples with the same time are 'odd' that still shouldn't be an excuse to incorrectly reset the ceiling value for them back to 0. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--profile.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/profile.c b/profile.c
index 1448b1750..5237edb7e 100644
--- a/profile.c
+++ b/profile.c
@@ -1874,7 +1874,10 @@ static void calculate_deco_information(struct dive *dive, struct divecomputer *d
if (min_pressure > tissue_tolerance)
tissue_tolerance = min_pressure;
}
- entry->ceiling = deco_allowed_depth(tissue_tolerance, surface_pressure, dive, !prefs.calc_ceiling_3m_incr);
+ if (t0 == t1)
+ entry->ceiling = (entry - 1)->ceiling;
+ else
+ entry->ceiling = deco_allowed_depth(tissue_tolerance, surface_pressure, dive, !prefs.calc_ceiling_3m_incr);
}
}