]> granicus.if.org Git - nethack/commitdiff
Fix symset menu
authorPasi Kallinen <paxed@alt.org>
Sun, 16 Feb 2020 19:46:45 +0000 (21:46 +0200)
committerPasi Kallinen <paxed@alt.org>
Sun, 16 Feb 2020 19:49:13 +0000 (21:49 +0200)
Symset entry index numbers weren't initialized when the symsets were
read from file, making the menu behave erratically. This looks like
a merge mistake.

src/files.c

index 1ffe4ce820d57ae7142a2f30f16f06cbd0f3d3b8..dd05153b19d17641ee206bb19b261dbf9ecc633d 100644 (file)
@@ -3390,6 +3390,7 @@ int which_set;
     g.symset[which_set].explicitly = TRUE;
     g.chosen_symset_start = g.chosen_symset_end = FALSE;
     g.symset_which_set = which_set;
+    g.symset_count = 0;
 
     config_error_init(TRUE, "symbols", FALSE);
 
@@ -3499,6 +3500,7 @@ int which_set;
                     g.symset_list = tmpsp;
                 else
                     lastsp->next = tmpsp;
+                tmpsp->idx = g.symset_count++;
                 tmpsp->name = dupstr(bufp);
                 tmpsp->desc = (char *) 0;
                 tmpsp->handling = H_UNK;