mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Explicitly copy a cylinder which was marked as "unused" in the planner
When planning a new dive (not replan!!!) based on an existing (planned) dive, the cylinders from the existing selected dive are copied. This patch guarantees that cylinders which had been marked as "unused" are indeed copied as well. Sounds strange at the first moment but makes sense because if one marks a cylinder explicitly as "unused" in the planner instead of deleting it that does mean that one wants to keep this cylinder to have it available and be able to reenable it later-on. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
This commit is contained in:
parent
3487612337
commit
c127a92e8e
1 changed files with 1 additions and 1 deletions
|
@ -670,7 +670,7 @@ void copy_cylinders(struct dive *s, struct dive *d, bool used_only)
|
||||||
memset(&d->cylinder[i], 0, sizeof(cylinder_t));
|
memset(&d->cylinder[i], 0, sizeof(cylinder_t));
|
||||||
}
|
}
|
||||||
for (i = j = 0; i < MAX_CYLINDERS; i++) {
|
for (i = j = 0; i < MAX_CYLINDERS; i++) {
|
||||||
if (!used_only || is_cylinder_used(s, i)) {
|
if (!used_only || is_cylinder_used(s, i) || s->cylinder[i].cylinder_use == NOT_USED) {
|
||||||
d->cylinder[j].type = s->cylinder[i].type;
|
d->cylinder[j].type = s->cylinder[i].type;
|
||||||
d->cylinder[j].type.description = copy_string(s->cylinder[i].type.description);
|
d->cylinder[j].type.description = copy_string(s->cylinder[i].type.description);
|
||||||
d->cylinder[j].gasmix = s->cylinder[i].gasmix;
|
d->cylinder[j].gasmix = s->cylinder[i].gasmix;
|
||||||
|
|
Loading…
Reference in a new issue