]> granicus.if.org Git - nethack/commitdiff
last? pickup_types
authorPatR <rankin@nethack.org>
Fri, 14 Dec 2018 07:52:35 +0000 (23:52 -0800)
committerPatR <rankin@nethack.org>
Fri, 14 Dec 2018 07:52:35 +0000 (23:52 -0800)
Although choose_classes_menu() is only used for objects, it is written
to handle monsters too.  My change to give <space> special handling
might have broken selecting ghosts if it's ever used for monsters so
fix that.

src/options.c

index 4c4d3f4ad011d1f00bb92385ad802f7e9149edcd..ead3a707aa7fd3938afaf2f82c8398335c07db71 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 options.c       $NHDT-Date: 1544751219 2018/12/14 01:33:39 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.346 $ */
+/* NetHack 3.6 options.c       $NHDT-Date: 1544773907 2018/12/14 07:51:47 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.347 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Michael Allison, 2008. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -6346,13 +6346,15 @@ char *class_select;
     n = select_menu(win, way ? PICK_ANY : PICK_ONE, &pick_list);
     destroy_nhwindow(win);
     if (n > 0) {
-        /* first check for 'all'; it means 'use a blank list'
-           rather than 'collect every possible choice' */
-        for (i = 0; i < n; ++i)
-            if (pick_list[i].item.a_int == ' ') {
-                pick_list[0].item.a_int = ' ';
-                n = 1; /* return 1; also an implicit 'break;' */
-            }
+        if (category == 1) {
+            /* for object classes, first check for 'all'; it means 'use
+               a blank list' rather than 'collect every possible choice' */
+            for (i = 0; i < n; ++i)
+                if (pick_list[i].item.a_int == ' ') {
+                    pick_list[0].item.a_int = ' ';
+                    n = 1; /* return 1; also an implicit 'break;' */
+                }
+        }
         for (i = 0; i < n; ++i)
             *class_select++ = (char) pick_list[i].item.a_int;
         free((genericptr_t) pick_list);