From 814a69f06105eea8c7dda4a0c9e311d7af1139be Mon Sep 17 00:00:00 2001 From: PatR Date: Sun, 22 Oct 2023 16:44:49 -0700 Subject: [PATCH] update a couple of tty perm_invent comments Gold can be quivered but not wielded, so remove the reference to the latter. Inuse-only mode gets passed lamps and leashes when they're actively used, so remove the reference to that being different from Qt's paperdoll. (It is actually different, but not because they won't be shown as in-use. The paperdoll only shows one of each but inventory of in-use items might have more than one of either or both.) Add a what-if comment to tools_in_use(). --- src/invent.c | 7 ++++++- win/tty/wintty.c | 18 +++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/invent.c b/src/invent.c index d32e1cc43..035f99030 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 invent.c $NHDT-Date: 1695159625 2023/09/19 21:40:25 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.449 $ */ +/* NetHack 3.7 invent.c $NHDT-Date: 1698017900 2023/10/22 23:38:20 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.455 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -4746,10 +4746,15 @@ dopramulet(void) static boolean tool_being_used(struct obj *obj) { + /* + * [Should this also include lit potions of oil? They're not tools + * but they are "in use" without being noticeable via obj->oworkmask.] + */ if ((obj->owornmask & (W_TOOL | W_SADDLE)) != 0L) return TRUE; if (obj->oclass != TOOL_CLASS) return FALSE; + /* [don't actually need to check uwep here; caller catches it] */ return (boolean) (obj == uwep || obj->lamplit || (obj->otyp == LEASH && obj->leashmon)); } diff --git a/win/tty/wintty.c b/win/tty/wintty.c index b04742444..9ad937800 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 wintty.c $NHDT-Date: 1695430217 2023/09/23 00:50:17 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.344 $ */ +/* NetHack 3.7 wintty.c $NHDT-Date: 1698017917 2023/10/22 23:38:37 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.354 $ */ /* Copyright (c) David Cohrs, 1991 */ /* NetHack may be freely redistributed. See license for details. */ @@ -3049,9 +3049,9 @@ selector_to_slot( /* * Inuse_only uses slots 0 to N-1 instead of fixed positions. * Caller--or caller's caller's ... caller--only passes us - * relevant items so no filtering is necessary here; '!show_gold' - * gets ignored here since gold might be quivered or wielded and - * become an in-use item. + * relevant items so no filtering is necessary here. + * '!show_gold' gets ignored here since gold might be quivered + * and become an in-use item. * Inuse_only items might include one (or more than one) with * invlet '#' but it isn't special for Inuse_only. * When nothing is in use, the core sends a menu header line to @@ -3219,13 +3219,9 @@ assesstty( /* "normal" max for items in use would be 3 weapon + 7 armor + 4 accessories == 14, but being punished and picking up the ball will add 1, and some quest artifacts have an an #invoke property that's - tracked via obj->owornmask so could add more; if hero ends up with - more than 15 in-use items, some will be left out; - Qt's "paper doll" adds first lit lamp/candle and first active - leash; those aren't tracked via owornmask so we don't notice them - [note: that was accurate when TTY_PERM_INVENT 'pulled' inventory - from the core but now that things have changed so that the core - 'pushes' inventory to us, it might no longer be true] */ + tracked via obj->owornmask so could add more; also, lit lamps/candles + and attached leashes are included; if hero ends up with more than + 15 in-use items, some will be left out */ if (inuse_only) *minrow = 1 + 15 + 1; /* top border + 15 lines + bottom border */ *maxrow = *minrow; /* FIXME: inuse_only should be able to use more