mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
0c28821d28
commit
b949bad026
10 changed files with 28 additions and 16 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue