From: PatR Date: Thu, 13 Jul 2017 00:53:04 +0000 (-0700) Subject: fix commit ebd6bb62f58a : #H4383 - blasted twice X-Git-Tag: NetHack-3.6.1_RC01~453 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0bb25b3884fdc9ce83571fc6769b3c746888047;p=nethack fix commit ebd6bb62f58a : #H4383 - blasted twice by Excalibur. Noticed on Reddit by Alex, the attempt to fix being blasted twice by wielded artifact weapon when changing alignment ended up preventing wielding other role's quest weapons. At the moment I can't even see how it prevented the double-blast.... This backs out that change and fixes the double-blasting correctly. When uwep and uswapwep are tested in advance of the rest of invent, mark them as already processed before entering the loop that checks all not-yet-processed inventory. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 03781df5f..e4a415273 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -455,6 +455,8 @@ attempting to name an item as an artifact and failing via hand slip violates crashes for 'A' above were downgraded to impossible "cursed without otmp" wizhelp: ^O is #overview in wizard mode too; #wizwhere shows dungeon layout wishing for tins sometimes yielded a tin wand +replace the fix for preventing putting on a helm of opposite alignment from + causing wielded Excalibur from blasting hero twice Platform- and/or Interface-Specific Fixes diff --git a/src/artifact.c b/src/artifact.c index 113843e78..6f8326df7 100644 --- a/src/artifact.c +++ b/src/artifact.c @@ -1888,7 +1888,7 @@ boolean loseit; /* whether to drop it if hero can longer touch it */ bane = bane_applies(get_artifact(obj), &youmonst); /* nothing else to do if hero can successfully handle this object */ - if (!ag && !bane && !touch_blasted) + if (!ag && !bane) return 1; /* hero can't handle this object, but didn't get touch_artifact()'s @@ -2008,11 +2008,15 @@ int dropflag; /* 0==don't drop, 1==drop all, 2==drop weapon */ dropit = (dropflag > 0); /* drop all or drop weapon */ /* check secondary weapon first, before possibly unwielding primary */ - if (u.twoweap) + if (u.twoweap) { + bypass_obj(uswapwep); /* so loop below won't process it again */ (void) untouchable(uswapwep, dropit); + } /* check primary weapon next so that they're handled together */ - if (uwep) + if (uwep) { + bypass_obj(uwep); /* so loop below won't process it again */ (void) untouchable(uwep, dropit); + } /* in case someone is daft enough to add artifact or silver saddle */ if (u.usteed && (obj = which_armor(u.usteed, W_SADDLE)) != 0) {