summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-10-20 22:25:38 +0300
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-10-20 22:25:38 +0300
commite919a0f2eac8bc4471b499b73a77c95e81240fd9 (patch)
tree4a13113f54227df35a6a97d46c01a8450720f4a8 /profile.c
parent45d4d5ecdec6d02b2564d512cd95118f474855e8 (diff)
downloadsubsurface-e919a0f2eac8bc4471b499b73a77c95e81240fd9.tar.gz
Add quick hack for "no sample pressure but tank index changed" case
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>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/profile.c b/profile.c
index e5c7238a6..60b9ab9d9 100644
--- 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)