]> granicus.if.org Git - nethack/commitdiff
fix #H4205 - take-off of covered items
authorPatR <rankin@nethack.org>
Sun, 24 Jan 2016 03:38:28 +0000 (19:38 -0800)
committerPatR <rankin@nethack.org>
Sun, 24 Jan 2016 03:38:28 +0000 (19:38 -0800)
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).

src/invent.c

index f230c32c0cb08d630ade66595ba259357d81d152..504f027225d9222fc15de9ee8ced47b7ff173d99 100644 (file)
@@ -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))