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.
This commit is contained in:
PatR
2021-01-28 17:10:18 -08:00
parent 41956e5798
commit 407acbf987
2 changed files with 9 additions and 3 deletions

View 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 ? "* " : " ");