]> granicus.if.org Git - nethack/commitdiff
discoveries/#known sorting fix
authorPatR <rankin@nethack.org>
Wed, 3 Mar 2021 23:03:31 +0000 (15:03 -0800)
committerPatR <rankin@nethack.org>
Wed, 3 Mar 2021 23:03:31 +0000 (15:03 -0800)
If the sort order for sortdiscoveries was s ('sortloot' order)
and any artifacts or unique items were discovered, using '\'
to see all discoveries included "Discovered Items" as a spurious
class header between the real header for the last object class with
discoveries and the discoveries for that class:
 |Discoveries, sortloot order (by class with some sub-class groupings)
 |
 |Artifacts
 |  Sunsword [lawful long sword]
 |Potions
 |  water (clear)
 |Gems/Stones
 |Discovered items
 |  diamond (white)
 |  flint stone (gray)

"Discovered items" is supposed to only be shown when sorting
alphabetically across all classes and there are artifacts and/or
unique items before the regular discovered objects.

doc/fixes37.0
src/o_init.c

index ed96bf3f9c9df0d12835c3c042b279b39bf93967..2caa463067015fb5157be8b0aed8501621252647 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.466 $ $NHDT-Date: 1614811211 2021/03/03 22:40:11 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.467 $ $NHDT-Date: 1614812488 2021/03/03 23:01:28 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -522,6 +522,8 @@ change to can_reach_floor() resulted in hero being unable to reach the floor
 panic if lua init fails
 change wizard mode command #wizmgender to wizard mode option 'wizmgender'
 engraving with non-blade dulled the weapon anyway (pr #464)
+'sortdiscoveries:s' had a spurious generic header shown at the start of the
+       last class if there were any artifacts or unique items discovered
 
 curses: 'msg_window' option wasn't functional for curses unless the binary
        also included tty support
index 68f3ba32b7476bc62f4e78edfb17f5e8f6e25fb2..3ebd7edc73be4e130939bcde5b2d3ba6e685af30 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 o_init.c        $NHDT-Date: 1611882611 2021/01/29 01:10:11 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.48 $ */
+/* NetHack 3.7 o_init.c        $NHDT-Date: 1614812489 2021/03/03 23:01:29 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.50 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2011. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -662,7 +662,7 @@ dodiscovered(void) /* free after Robert Viduya */
                relevant header above; if we're alphabetizing across all
                classes, we normally don't need a header; but it we showed
                any unique items or any artifacts then we do need one */
-            if ((uniq_ct || arti_ct) && !alphabyclass)
+            if ((uniq_ct || arti_ct) && alphabetized && !alphabyclass)
                 putstr(tmpwin, iflags.menu_headings, "Discovered items");
             qsort(sorted_lines, sorted_ct, sizeof (char *), discovered_cmp);
             for (j = 0; j < sorted_ct; ++j) {