]> granicus.if.org Git - nethack/commitdiff
fix commit ebd6bb62f58a : #H4383 - blasted twice
authorPatR <rankin@nethack.org>
Thu, 13 Jul 2017 00:53:04 +0000 (17:53 -0700)
committerPatR <rankin@nethack.org>
Thu, 13 Jul 2017 00:53:04 +0000 (17:53 -0700)
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.

doc/fixes36.1
src/artifact.c

index 03781df5f44a31bdd33c88ec85dde0563486a020..e4a415273a4d0df989c8b7e1586c3030a326462c 100644 (file)
@@ -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
index 113843e789f3438ebb0231fe981efcc0fe2e68b2..6f8326df7835300d3ff90333909249b9f688ebc5 100644 (file)
@@ -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) {