]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Add quick hack for "no sample pressure but tank index changed" case
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 Oct 2011 19:25:38 +0000 (22:25 +0300)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 Oct 2011 19:25:38 +0000 (22:25 +0300)
This isn't right if you switch back to the same cylinder multiple times,
but for the first time it kind of works - just take the beginning
cylinder pressure if we have one.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
profile.c

index e5c7238a6b0fc683bccd19372aed88b4e822472c..60b9ab9d9df85dd8cb99db3b33193a5bc9f07ae7 100644 (file)
--- a/profile.c
+++ b/profile.c
@@ -719,6 +719,8 @@ static struct plot_info *create_plot_info(struct dive *dive)
                entry->same_cylinder = sample->cylinderindex == cylinderindex;
                cylinderindex = sample->cylinderindex;
                entry->pressure = sample->cylinderpressure.mbar;
+               if (!entry->same_cylinder && !entry->pressure)
+                       entry->pressure = dive->cylinder[cylinderindex].start.mbar;
                entry->temperature = sample->temperature.mkelvin;
 
                if (depth || lastdepth)