summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/divelist.c b/divelist.c
index 1398c78e8..75f427892 100644
--- a/divelist.c
+++ b/divelist.c
@@ -40,12 +40,8 @@
#include <math.h>
#include <glib/gi18n.h>
#include <assert.h>
-#ifdef LIBZIP
#include <zip.h>
-#endif
-#ifdef XSLT
#include <libxslt/transform.h>
-#endif
#include "dive.h"
#include "divelist.h"
@@ -925,7 +921,10 @@ void select_dive(int idx)
{
struct dive *dive = get_dive(idx);
if (dive) {
- if (!dive->selected){
+ /* never select an invalid dive that isn't displayed */
+ if (dive->dive_tags & DTAG_INVALID && !prefs.display_invalid_dives)
+ return;
+ if (!dive->selected) {
dive->selected = 1;
amount_selected++;
}