]> granicus.if.org Git - nethack/commitdiff
fix C343-357 Rust monsters may chew non-ferrous items
authornhmall <mjnh@persona.ca>
Sat, 28 Mar 2015 22:08:09 +0000 (18:08 -0400)
committernhmall <mjnh@persona.ca>
Sat, 28 Mar 2015 22:08:09 +0000 (18:08 -0400)
 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.

src/mon.c

index 607845e7abf2782726f760cee7006452b429640d..41d17e6715d361d1215f34c85b2f7b9cc4aefc83 100644 (file)
--- 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));