summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-28 14:50:40 +0200
committerGravatar Robert C. Helling <helling@atdotde.de>2020-05-01 12:36:28 +0200
commitb949bad026c8bab7611998fb0fcf9f6008dbd7e9 (patch)
treebda7c10206612274a204b31412ae6999b8cc13b0 /commands
parent0c28821d2895e246295884891df02e924eb8e359 (diff)
downloadsubsurface-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 'commands')
-rw-r--r--commands/command_edit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp
index 0e1159f6d..c763cbffa 100644
--- a/commands/command_edit.cpp
+++ b/commands/command_edit.cpp
@@ -1167,7 +1167,7 @@ void RemoveCylinder::undo()
{
for (size_t i = 0; i < dives.size(); ++i) {
std::vector<int> mapping = get_cylinder_map_for_add(dives[i]->cylinders.nr, indexes[i]);
- add_to_cylinder_table(&dives[i]->cylinders, indexes[i], clone_cylinder(cyl[i]));
+ add_cylinder(&dives[i]->cylinders, indexes[i], clone_cylinder(cyl[i]));
emit diveListNotifier.cylinderAdded(dives[i], indexes[i]);
invalidate_dive_cache(dives[i]); // Ensure that dive is written in git_save()
}