From b949bad026c8bab7611998fb0fcf9f6008dbd7e9 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 28 Apr 2020 14:50:40 +0200 Subject: 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 --- commands/command_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'commands') 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 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() } -- cgit v1.2.3-70-g09d2