]> granicus.if.org Git - nethack/commitdiff
eating artifacts while poly'd
authornethack.rankin <nethack.rankin>
Thu, 25 Jan 2007 06:24:39 +0000 (06:24 +0000)
committernethack.rankin <nethack.rankin>
Thu, 25 Jan 2007 06:24:39 +0000 (06:24 +0000)
     From the newsgroup:  if polymorphed into a metallivore, you could eat
artifacts that you couldn't touch with your hands.  Now you can't eat ones
which evade your grasp, and you take some damage from other touchy items
on--actually, prior to--the first bite.  (Those still "taste delicious" if
you survive; I'm not sure whether this ought to be changed.)

doc/fixes34.4
src/eat.c

index 6e3088ecc663340dbf0df060a93bd03f120c291d..db8d50b0a01c43b844dadd06e5ed268d9a41437b 100644 (file)
@@ -294,6 +294,7 @@ can't arm bear traps or land mines on Planes of Air or Water
 statues that "come to life" when trap activates shouldn't start out sleeping
 shopkeepers and priests wouldn't step on graves put in their rooms by bones
 can't throw if poly'd into form which lacks hands
+can't eat an artifact you're unable to touch
 
 
 Platform- and/or Interface-Specific Fixes
index ef66a1ec505a45e9e4f5159f8149e787685123d0..1e5299106aa89be3933686bbf92d1f8e4d7b54c0 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)eat.c      3.5     2006/12/07      */
+/*     SCCS Id: @(#)eat.c      3.5     2007/01/24      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -2256,7 +2256,9 @@ doeat()           /* generic "eat" command funtion (see cmd.c) */
         * mails, players who polymorph back to human in the middle of their
         * metallic meal, etc....
         */
-       if (!is_edible(otmp)) {
+       if (otmp->oartifact && !touch_artifact(otmp, &youmonst)) {
+           return 1;
+       } else if (!is_edible(otmp)) {
            You("cannot eat that!");
            return 0;
        } else if ((otmp->owornmask & (W_ARMOR|W_TOOL|W_AMUL