From: PatR Date: Fri, 29 Jan 2021 01:10:18 +0000 (-0800) Subject: fix class discovery for fully discovered class X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=407acbf987fee60c93141b78bc297ec0a44fd15f;p=nethack fix class discovery for fully discovered class 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. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 007082cba..1a3f56d2e 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -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 diff --git a/src/o_init.c b/src/o_init.c index a920e05f5..13058f98b 100644 --- a/src/o_init.c +++ b/src/o_init.c @@ -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 ? "* " : " ");