summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/setup/multiplayer.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/setup/multiplayer.c b/src/setup/multiplayer.c
index 35552349..8b461066 100644
--- a/src/setup/multiplayer.c
+++ b/src/setup/multiplayer.c
@@ -66,7 +66,7 @@ static char *iwad_labels[8];
// Index of the currently selected IWAD
-static int found_iwad_selected;
+static int found_iwad_selected = -1;
// Filename to pass to '-iwad'.
@@ -599,9 +599,15 @@ static txt_widget_t *IWADSelector(void)
result = (txt_widget_t *) dropdown;
}
- // Select first in the list.
+ // The first time the dialog is opened, found_iwad_selected=-1,
+ // so select the first IWAD in the list. Don't lose the setting
+ // if we close and reopen the dialog.
+
+ if (found_iwad_selected < 0 || found_iwad_selected >= num_iwads)
+ {
+ found_iwad_selected = 0;
+ }
- found_iwad_selected = 0;
IWADSelected(NULL, NULL);
return result;