mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Fix duration calculation
Some days I'm just a f*cking moron. That code was so stupid that I'm lacking words. I replaced using the first divecomputer with using the last divecomputer. When what I wanted was to use the maximum duration. This looks better. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b119f7fcd4
commit
74ff9f1ead
1 changed files with 2 additions and 2 deletions
4
dive.c
4
dive.c
|
@ -221,10 +221,10 @@ static void update_duration(duration_t *duration, int new)
|
|||
|
||||
int get_duration_in_sec(struct dive *dive)
|
||||
{
|
||||
int duration;
|
||||
int duration = 0;
|
||||
struct divecomputer *dc = &dive->dc;
|
||||
do {
|
||||
duration = dc->duration.seconds;
|
||||
duration = MAX(duration, dc->duration.seconds);
|
||||
dc = dc->next;
|
||||
} while (dc);
|
||||
return duration;
|
||||
|
|
Loading…
Reference in a new issue