diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-01-08 13:43:25 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-08 13:43:25 -0800 |
commit | 8eb92c576c040b5366d3ac2511ccf579882be9a7 (patch) | |
tree | f64427affe843ee42caf75dc91bfcae336106b7b /planner.c | |
parent | 8b24784a7a5886b23815f9b4657400596f1fe274 (diff) | |
download | subsurface-8eb92c576c040b5366d3ac2511ccf579882be9a7.tar.gz |
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>
Diffstat (limited to 'planner.c')
-rw-r--r-- | planner.c | 2 |
1 files changed, 1 insertions, 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; |