summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-01 12:38:32 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-06-01 12:43:40 -0700
commitc539c8f861928c637f6b3e790b05e89914e2be8f (patch)
tree9728f8d08279bbe98fa8afdec73de9de1d55b66a /divelist.c
parent1a040134538b7733f3088ea34f101cfedecc2c64 (diff)
downloadsubsurface-c539c8f861928c637f6b3e790b05e89914e2be8f.tar.gz
Remove the .used member of the cylinder structure
Instead calculate this information on the fly, taking into account all dive computers on the dive in questions. There is one wrinkle to this - previously we abused the '.used' member to make sure that a manually added cylinder didn't disappear the moment it was added (think of the workflow: you add a cylinder, then you add a gas change to that cylinder -> right after you add it it is unused and would not be shown). I am thinking that we might have to add the "manually_added" property to the properties that we store in XML / git. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/divelist.c b/divelist.c
index 421ea28c2..489982465 100644
--- a/divelist.c
+++ b/divelist.c
@@ -116,7 +116,7 @@ void get_dive_gas(struct dive *dive, int *o2_p, int *he_p, int *o2low_p)
int o2 = get_o2(&cyl->gasmix);
int he = get_he(&cyl->gasmix);
- if (!cyl->used)
+ if (cylinder_is_used(dive, cyl))
continue;
if (cylinder_none(cyl))
continue;