diff --git a/doc/fixes35.0 b/doc/fixes35.0 index f7efa6e2e..771e13ade 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -148,6 +148,7 @@ limit recursive calls to spoteffects (poly'd hero fell into water, reverted ensure that the punishment ball and chain make it into the save file after being temporarily orphaned from the normal chains in the swallowing code charge for thrown wand that shatters into a thousand pieces in a shop +wielded light source susceptible to water gets extinguished when weapon rusts Platform- and/or Interface-Specific Fixes diff --git a/src/trap.c b/src/trap.c index ba05e90bc..bb05aa4e1 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)trap.c 3.5 2006/05/08 */ +/* SCCS Id: @(#)trap.c 3.5 2006/06/16 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -892,8 +892,10 @@ glovecheck: (void) rust_dmg(uarmg, "gauntlets", 1, TRUE, &youmonst); goto glovecheck; default: pline("%s you!", A_gush_of_water_hits); - for (otmp=invent; otmp; otmp = otmp->nobj) - (void) snuff_lit(otmp); + for (otmp = invent; otmp; otmp = otmp->nobj) + if (otmp->lamplit && otmp != uwep && + (otmp != uswapwep || !u.twoweap)) + (void) snuff_lit(otmp); if (uarmc) (void) rust_dmg(uarmc, cloak_simple_name(uarmc), 1, TRUE, &youmonst); @@ -1980,24 +1982,22 @@ glovecheck: target = which_armor(mtmp, W_ARMG); if (in_sight) pline("%s %s!", A_gush_of_water_hits, mon_nam(mtmp)); - for (otmp=mtmp->minvent; otmp; otmp = otmp->nobj) - (void) snuff_lit(otmp); - target = which_armor(mtmp, W_ARMC); - if (target) - (void) rust_dmg(target, cloak_simple_name(target), - 1, TRUE, mtmp); - else { - target = which_armor(mtmp, W_ARM); - if (target) - (void) rust_dmg(target, "armor", 1, TRUE, mtmp); + for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj) + if (otmp->lamplit && + (otmp->owornmask & (W_WEP|W_SWAPWEP)) == 0) + (void) snuff_lit(otmp); + if ((target = which_armor(mtmp, W_ARMC)) != 0) + (void) rust_dmg(target, + cloak_simple_name(target), + 1, TRUE, mtmp); + else if ((target = which_armor(mtmp, W_ARM)) != 0) + (void) rust_dmg(target, "armor", 1, TRUE, mtmp); #ifdef TOURIST - else { - target = which_armor(mtmp, W_ARMU); - (void) rust_dmg(target, "shirt", 1, TRUE, mtmp); - } + else if ((target = which_armor(mtmp, W_ARMU)) != 0) + (void) rust_dmg(target, "shirt", 1, TRUE, mtmp); #endif - } } + if (mptr == &mons[PM_IRON_GOLEM]) { if (in_sight) pline("%s falls to pieces!", Monnam(mtmp)); diff --git a/src/wield.c b/src/wield.c index 1708c4d86..c6507c2e3 100644 --- a/src/wield.c +++ b/src/wield.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)wield.c 3.5 2006/04/14 */ +/* SCCS Id: @(#)wield.c 3.5 2006/06/16 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -619,6 +619,7 @@ boolean for_dip; struct monst *victim; boolean vismon, visobj, chill; boolean ret = FALSE; + boolean already_affected = FALSE; if (!target) return FALSE; @@ -627,6 +628,10 @@ boolean for_dip; vismon = victim && (victim != &youmonst) && canseemon(victim); visobj = !victim && cansee(bhitpos.x, bhitpos.y); /* assume thrown */ + if (!acid_dmg && target->lamplit) { + already_affected = snuff_lit(target); + if (already_affected) ret = TRUE; + } erosion = acid_dmg ? target->oeroded2 : target->oeroded; if (target->greased) { @@ -671,7 +676,8 @@ boolean for_dip; (acid_dmg ? !is_corrodeable(target) : !is_rustprone(target))) { if (flags.verbose || !(target->oerodeproof && target->rknown)) { if (((victim == &youmonst) || vismon) && !for_dip) - pline("%s not affected.", Yobjnam2(target, "are")); + pline("%s not %s.", Yobjnam2(target, "are"), + already_affected ? "harmed" : "affected"); /* no message if not carried or dipping */ } if (target->oerodeproof) target->rknown = !for_dip;