]> granicus.if.org Git - nethack/commitdiff
fix class discovery for fully discovered class
authorPatR <rankin@nethack.org>
Fri, 29 Jan 2021 01:10:18 +0000 (17:10 -0800)
committerPatR <rankin@nethack.org>
Fri, 29 Jan 2021 01:10:18 +0000 (17:10 -0800)
This was caused by a post-3.6 change I made when adding sorting
capability to '`' (and to '\' but that wasn't affected).  Cited
case was lack of "water" when all potions had been discovered.
Some other classes (but not all) were vulnerable too.

doc/fixes37.0
src/o_init.c

index 007082cba622aeeed0e951f157e3e679b8e6c181..1a3f56d2ee8fcd7740c3ddb29169347d095526cc 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.435 $ $NHDT-Date: 1611525309 2021/01/24 21:55:09 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.437 $ $NHDT-Date: 1611882611 2021/01/29 01:10:11 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -375,6 +375,8 @@ spells that require a target spot rather than a direction (like skilled
        feedback stating hero failed to hold location sufficiently in mind;
        when not blind, such spells left autodescribe feedback for target spot
        in the message window while the spell was being performed
+prevent wish request "death wand" from matching Death monster and producing a
+       random wand instead of a wand of death
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
@@ -494,6 +496,10 @@ replace "aligned priest" entries in Pri-loca.lua, astral.lua, minetn-1.lua,
 attempting to swap places with a peaceful monster might cause it to flee
 gender-specific monster names can be used in .lua files with the gender upheld
 remove unused vision tables
+changes accompanying sorting of discoveries resulted in omitting very last
+       item for '`'/#knownclass on a class where every item was discoverable
+       and had no extra labels (so potions and rings, possibly others, but
+       not scrolls or wands) and every item was actually discovered
 
 curses: 'msg_window' option wasn't functional for curses unless the binary
        also included tty support
index a920e05f5b44bba8f88c054da396de2b98dbf274..13058f98b3d7dd15d1efcbf92ac1417b9bf5ee0a 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.7 o_init.c        $NHDT-Date: 1596498193 2020/08/03 23:43:13 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.43 $ */
+/* NetHack 3.7 o_init.c        $NHDT-Date: 1611882611 2021/01/29 01:10:11 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.48 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Robert Patrick Rankin, 2011. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -859,7 +859,7 @@ doclassdisco(void)
                   : "alphabetical order");
         putstr(tmpwin, 0, buf); /* skip iflags.menu_headings */
         sorted_ct = 0;
-        for (i = g.bases[(int) oclass]; i < g.bases[oclass + 1] - 1; ++i) {
+        for (i = g.bases[(int) oclass]; i <= g.bases[oclass + 1] - 1; ++i) {
             if ((dis = g.disco[i]) != 0 && interesting_to_discover(dis)) {
                 ++ct;
                 Strcpy(buf,  objects[dis].oc_pre_discovered ? "* " : "  ");