From 5fcbf50f2c2a1ca0284a2ad1e8e8b02a47d67c99 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 14 Dec 2002 11:22:10 +0000 Subject: [PATCH] fix B14020 - unquivering with 'A' Ahe 'A' command would not let you remove a cursed item from the quiver or alternate weapon slot. But other commands such as drop or quiver would let you get rid of such things since they aren't considered to be welded in place the way a wielded weapon is. This seemingly minor bug is more significant than first appears because it opens a loophole to allow you determine whether any held item is cursed: quiver it, try to remove it with 'A' and possibly be told that it's cursed, really remove it with 'Q' if so. --- doc/fixes34.1 | 1 + src/do_wear.c | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 09c926a55..12db520d0 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -326,6 +326,7 @@ not all cavemen are human, so avoid using human in quest messages tengu is singular and plural, some rumors were incorrect don't let leader or nemesis be renamed non-moving monster are not affected by liquid +'A' command wouldn't remove cursed item from quiver or alternate weapon slot Platform- and/or Interface-Specific Fixes diff --git a/src/do_wear.c b/src/do_wear.c index 32f16b40d..84a76464d 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)do_wear.c 3.4 2002/09/30 */ +/* SCCS Id: @(#)do_wear.c 3.4 2002/11/29 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1652,6 +1652,7 @@ register struct obj *otmp; if (!otmp) return 0; *buf = '\0'; /* lint suppresion */ + /* special ring checks */ if (otmp == uright || otmp == uleft) { if (nolimbs(youmonst.data)) { pline_The("ring is stuck."); @@ -1671,6 +1672,7 @@ register struct obj *otmp; return 0; } } + /* special glove checks */ if (otmp == uarmg) { if (welded(uwep)) { You("are unable to take off your %s while wielding that %s.", @@ -1683,6 +1685,7 @@ register struct obj *otmp; return 0; } } + /* special boot checks */ if (otmp == uarmf) { if (u.utrap && u.utraptype == TT_BEARTRAP) { pline_The("bear trap prevents you from pulling your %s out.", @@ -1694,6 +1697,7 @@ register struct obj *otmp; return 0; } } + /* special suit and shirt checks */ if (otmp == uarm #ifdef TOURIST || otmp == uarmu @@ -1720,8 +1724,13 @@ register struct obj *otmp; return 0; } } - /* fundamental, but other impediments are checked first */ - if (cursed(otmp)) return 0; + /* basic curse check */ + if (otmp == uquiver || (otmp == uswapwep && !u.twoweap)) { + ; /* some items can be removed even when cursed */ + } else { + /* otherwise, this is fundamental */ + if (cursed(otmp)) return 0; + } if(otmp == uarm) takeoff_mask |= WORN_ARMOR; else if(otmp == uarmc) takeoff_mask |= WORN_CLOAK; -- 2.40.0