From: PatR Date: Sat, 23 Dec 2017 23:42:20 +0000 (-0800) Subject: fix #H6648 - can't wear via 'W' but can via 'P' X-Git-Tag: NetHack-3.7.0_WIP~729^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=062748c69554e276ad798e92c69ce13a27f2985f;p=nethack 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. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 80e792766..69724485b 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -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 diff --git a/src/do_wear.c b/src/do_wear.c index 2adcb6816..f8f94e342 100644 --- a/src/do_wear.c +++ b/src/do_wear.c @@ -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; }