fix commit ebd6bb62f5 : #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.
This commit is contained in:
PatR
2017-07-12 17:53:04 -07:00
parent a573134d7e
commit c0bb25b388
2 changed files with 9 additions and 3 deletions

View 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

View 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) {