From: PatR Date: Wed, 3 Mar 2021 23:03:31 +0000 (-0800) Subject: discoveries/#known sorting fix X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=621c9436bcae908917fd06c941d9d4d0f0f51170;p=nethack discoveries/#known sorting fix 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. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index ed96bf3f9..2caa46306 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -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 diff --git a/src/o_init.c b/src/o_init.c index 68f3ba32b..3ebd7edc7 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -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) {