mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Planner: only copy cylinders that were used in the template dive
This was only semi-implemented the first time around. Now we really only copy the ones that are indeed used. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
88f3991260
commit
5bc5cae6dc
4 changed files with 12 additions and 9 deletions
7
dive.c
7
dive.c
|
@ -308,13 +308,16 @@ int nr_weightsystems(struct dive *dive)
|
|||
return nr;
|
||||
}
|
||||
|
||||
void copy_cylinders(struct dive *s, struct dive *d)
|
||||
void copy_cylinders(struct dive *s, struct dive *d, bool used_only)
|
||||
{
|
||||
int i;
|
||||
if (!s || !d)
|
||||
return;
|
||||
for (i = 0; i < MAX_CYLINDERS; i++)
|
||||
d->cylinder[i] = s->cylinder[i];
|
||||
if (!used_only || cylinder_is_used(s, &s->cylinder[i]))
|
||||
d->cylinder[i] = s->cylinder[i];
|
||||
else
|
||||
memset(&d->cylinder[i], 0, sizeof(cylinder_t));
|
||||
}
|
||||
|
||||
void copy_samples(struct dive *s, struct dive *d)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue