mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Really prevent time travel in planner dive edit
Commit c92e4535a6de "Prevent time travel in planner dive edit" almost got it right but had a stupid think-o. This commit should fix it the right way. If the duration that is passed in is before the previous timestamp, then this is most likely intended to be a relative time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8b24784a7a
commit
8eb92c576c
1 changed files with 1 additions and 1 deletions
|
@ -227,7 +227,7 @@ void add_duration_to_nth_dp(struct diveplan *diveplan, int idx, int duration, gb
|
|||
struct divedatapoint *pdp, *dp = get_nth_dp(diveplan, idx);
|
||||
if (idx > 0) {
|
||||
pdp = get_nth_dp(diveplan, idx - 1);
|
||||
if (is_rel || dp->time <= pdp->time)
|
||||
if (is_rel || duration <= pdp->time)
|
||||
duration += pdp->time;
|
||||
}
|
||||
dp->time = duration;
|
||||
|
|
Loading…
Reference in a new issue