mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Support relative times in diveplanner input "on the fly" mode
This had gotten lost when updating the profile on the fly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d281ad84fd
commit
85ed689dc0
3 changed files with 8 additions and 4 deletions
|
|
@ -179,9 +179,13 @@ struct divedatapoint *get_nth_dp(struct diveplan *diveplan, int idx)
|
|||
return dp;
|
||||
}
|
||||
|
||||
void add_duration_to_nth_dp(struct diveplan *diveplan, int idx, int duration)
|
||||
void add_duration_to_nth_dp(struct diveplan *diveplan, int idx, int duration, gboolean is_rel)
|
||||
{
|
||||
struct divedatapoint *dp = get_nth_dp(diveplan, idx);
|
||||
struct divedatapoint *pdp, *dp = get_nth_dp(diveplan, idx);
|
||||
if (idx > 0 && is_rel) {
|
||||
pdp = get_nth_dp(diveplan, idx - 1);
|
||||
duration += pdp->time;
|
||||
}
|
||||
dp->time = duration;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue