diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-28 14:50:40 +0200 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2020-05-01 12:36:28 +0200 |
commit | b949bad026c8bab7611998fb0fcf9f6008dbd7e9 (patch) | |
tree | bda7c10206612274a204b31412ae6999b8cc13b0 /core/planner.c | |
parent | 0c28821d2895e246295884891df02e924eb8e359 (diff) | |
download | subsurface-b949bad026c8bab7611998fb0fcf9f6008dbd7e9.tar.gz |
core: always keep an empty cylinder at the end of the cylinder array
This will be temporarilly used by the planner to mark consumption of
air at the surface. Do this by creating a new function add_cylinder,
which replaces add_to_cylinder_table() and takes care of always adding
a dummy cylinder at the end of the table. Make the original
add_to_cylinder_table() local, so that it cannot be accessed anymore.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/planner.c')
-rw-r--r-- | core/planner.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/planner.c b/core/planner.c index a5f0d36bc..8cadaca01 100644 --- a/core/planner.c +++ b/core/planner.c @@ -1074,7 +1074,7 @@ bool plan(struct deco_state *ds, struct diveplan *diveplan, struct dive *dive, i // If no empty cylinder is found, keep using last deco gas cylinder_t cyl = empty_cylinder; cyl.cylinder_use = NOT_USED; - add_to_cylinder_table(&dive->cylinders, dive->cylinders.nr, cyl); + add_cylinder(&dive->cylinders, dive->cylinders.nr, cyl); current_cylinder = dive->cylinders.nr - 1; plan_add_segment(diveplan, prefs.surface_segment, 0, current_cylinder, 0, false, OC); } |