diff options
Diffstat (limited to 'core/dive.c')
-rw-r--r-- | core/dive.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/dive.c b/core/dive.c index b091e2bc7..d7b423ad8 100644 --- a/core/dive.c +++ b/core/dive.c @@ -3588,11 +3588,11 @@ void average_max_depth(struct diveplan *dive, int *avg_depth, int *max_depth) while (dp) { if (dp->time) { /* Ignore gas indication samples */ - integral += (dp->depth + last_depth) * (dp->time - last_time) / 2; + integral += (dp->depth.mm + last_depth) * (dp->time - last_time) / 2; last_time = dp->time; - last_depth = dp->depth; - if (dp->depth > *max_depth) - *max_depth = dp->depth; + last_depth = dp->depth.mm; + if (dp->depth.mm > *max_depth) + *max_depth = dp->depth.mm; } dp = dp->next; } |