From: PatR Date: Sun, 24 Jan 2016 03:38:28 +0000 (-0800) Subject: fix #H4205 - take-off of covered items X-Git-Tag: NetHack-3.6.1_RC01~986 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=853efee6614ba66fd7017cf7ece369074bb9b828;p=nethack fix #H4205 - take-off of covered items Bug report subject was "menu interface things" but this isn't related to menus, just getobj(). Make the requested change to not list worn suit as a likely candidate for T (and R) if a worn cloak is going to prevent it from being removed. (Suit can still be picked, but the take-off operation for it will be refused, same as when it was being listed as a candidate.) In discussion about the request, there was a separate suggestion that cloaks shouldn't interfere with removing things underneath since they're generally sleeveless. I haven't done that; I think it is better to keep the layering as it is. The bug report also asked for the likely candidates when writing with a magic marker to exclude non-blank scrolls and books. That has been implemented already (post-3.6.0). --- diff --git a/src/invent.c b/src/invent.c index f230c32c0..504f02722 100644 --- a/src/invent.c +++ b/src/invent.c @@ -1131,9 +1131,10 @@ register const char *let, *word; && (!Is_astralevel(&u.uz) ^ (otmp->oclass != AMULET_CLASS))) /* suppress container being stashed into */ || (!strcmp(word, "stash") && !ck_bag(otmp)) - /* worn armor or accessory covered by cursed worn armor */ + /* worn armor (shirt, suit) covered by worn armor (suit, cloak) + or accessory (ring) covered by cursed worn armor (gloves) */ || (taking_off(word) - && inaccessible_equipment(otmp, (const char *) 0, TRUE)) + && inaccessible_equipment(otmp, (const char *) 0, FALSE)) || (!strcmp(word, "write on") && (!(otyp == SCR_BLANK_PAPER || otyp == SPE_BLANK_PAPER) || !otmp->dknown || !objects[otyp].oc_name_known))