From: nhmall Date: Sat, 28 Mar 2015 22:08:09 +0000 (-0400) Subject: fix C343-357 Rust monsters may chew non-ferrous items X-Git-Tag: NetHack-3.6.0_RC01~521 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e69b5ae944f4fc3fa8c87300a648d499eae6e7ff;p=nethack fix C343-357 Rust monsters may chew non-ferrous items Changes to be committed: modified: src/mon.c website should be updated to reflect this bug closure. C343-357 Rust monsters may chew non-ferrous items. --- diff --git a/src/mon.c b/src/mon.c index 607845e7a..41d17e671 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 mon.c $NHDT-Date: 1426465438 2015/03/16 00:23:58 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.139 $ */ +/* NetHack 3.5 mon.c $NHDT-Date: 1427580482 2015/03/28 22:08:02 $ $NHDT-Branch: master $:$NHDT-Revision: 1.142 $ */ /* NetHack 3.5 mon.c $Date: 2012/05/16 02:15:10 $ $Revision: 1.126 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -615,7 +615,10 @@ meatmetal(mtmp) /* Eats topmost metal object if it is there */ for (otmp = level.objects[mtmp->mx][mtmp->my]; otmp; otmp = otmp->nexthere) { - if (mtmp->data == &mons[PM_RUST_MONSTER] && !is_rustprone(otmp)) + /* Don't eat indigestible/choking/inappropriate objects */ + if ((mtmp->data == &mons[PM_RUST_MONSTER] && !is_rustprone(otmp)) || + (otmp->otyp == AMULET_OF_STRANGULATION) || + (otmp->otyp == RIN_SLOW_DIGESTION)) continue; if (is_metallic(otmp) && !obj_resists(otmp, 5, 95) && touch_artifact(otmp,mtmp)) { @@ -632,9 +635,7 @@ meatmetal(mtmp) pline("%s spits %s out in disgust!", Monnam(mtmp), distant_name(otmp,doname)); } - /* KMH -- Don't eat indigestible/choking objects */ - } else if (otmp->otyp != AMULET_OF_STRANGULATION && - otmp->otyp != RIN_SLOW_DIGESTION) { + } else { if (cansee(mtmp->mx,mtmp->my) && flags.verbose) pline("%s eats %s!", Monnam(mtmp), distant_name(otmp,doname));