fix #H6648 - can't wear via 'W' but can via 'P'

More fallout from allowing W/T on accessories and P/R on armor without
combining them outright.  If poly'd into verysmall or nohands critter,
'W' yields "don't even bother" before even prompting what to wear, but
'P' would prompt for an accessory and then wear armor if that was what
got picked.  Now 'P' will still prompt, in case it's for an accessory,
but picking a piece of armor no longer wears that armor.

'W' still doesn't even prompt, so won't allow accessories as well as
no armor.  I'm not sure whether that should be changed.
This commit is contained in:
PatR
2017-12-23 15:42:20 -08:00
parent 93f61975f5
commit 062748c695
2 changed files with 12 additions and 2 deletions

View File

@@ -490,6 +490,8 @@ if a fiery monster, wand of fire, or fiery explosion burned up a paper golem,
it could still leave blank scrolls
hero poly'd into paper or straw golem reverts to human if burned up even when
Unchanging without any explanation given
hero polymorphed into form which can't wear armor via 'W' (eliciting "don't
even bother") could wear it via 'P'
Fixes to Post-3.6.0 Problems that Were Exposed Via git Repository

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 do_wear.c $NHDT-Date: 1496959478 2017/06/08 22:04:38 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.98 $ */
/* NetHack 3.6 do_wear.c $NHDT-Date: 1514072526 2017/12/23 23:42:06 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.100 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1617,6 +1617,14 @@ boolean noisy;
int err = 0;
const char *which;
/* this is the same check as for 'W' (dowear), but different message,
in case we get here via 'P' (doputon) */
if (verysmall(youmonst.data) || nohands(youmonst.data)) {
if (noisy)
You("can't wear any armor in your current form.");
return 0;
}
which = is_cloak(otmp)
? c_cloak
: is_shirt(otmp)
@@ -1964,7 +1972,7 @@ dowear()
/* cantweararm() checks for suits of armor, not what we want here;
verysmall() or nohands() checks for shields, gloves, etc... */
if ((verysmall(youmonst.data) || nohands(youmonst.data))) {
if (verysmall(youmonst.data) || nohands(youmonst.data)) {
pline("Don't even bother.");
return 0;
}