summaryrefslogtreecommitdiffstats
path: root/core/statistics.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-12-13 07:02:15 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-03-20 15:20:44 -0700
commitf4f15039ac780903102eb101918329c6a488b9c3 (patch)
tree37ecd1cf1ec710be9d5e4c897a88bcb12f38d3ca /core/statistics.c
parent0d78fe45c31e2856a68d63235ad6acc8f50312f1 (diff)
downloadsubsurface-f4f15039ac780903102eb101918329c6a488b9c3.tar.gz
Ignore invalid dives in statistics
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/statistics.c')
-rw-r--r--core/statistics.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/statistics.c b/core/statistics.c
index a83878300..d37e4794f 100644
--- a/core/statistics.c
+++ b/core/statistics.c
@@ -165,6 +165,8 @@ void calculate_stats_summary(struct stats_summary *out, bool selected_only)
for_each_dive (idx, dp) {
if (selected_only && !dp->selected)
continue;
+ if (dp->invalid)
+ continue;
process_dive(dp, &stats);
/* yearly statistics */
@@ -296,7 +298,7 @@ void calculate_stats_selected(stats_t *stats_selection)
nr = 0;
for_each_dive(i, dive) {
- if (dive->selected) {
+ if (dive->selected && !dive->invalid) {
process_dive(dive, stats_selection);
nr++;
}
@@ -404,7 +406,7 @@ void selected_dives_gas_parts(volume_t *o2_tot, volume_t *he_tot)
int i, j;
struct dive *d;
for_each_dive (i, d) {
- if (!d->selected)
+ if (!d->selected || d->invalid)
continue;
volume_t *diveGases = get_gas_used(d);
for (j = 0; j < d->cylinders.nr; j++) {