]> granicus.if.org Git - nethack/commitdiff
Hero polyed into ghoul can eat only non-veggy corpses or eggs
authorPasi Kallinen <paxed@alt.org>
Sat, 8 Oct 2016 10:57:39 +0000 (13:57 +0300)
committerPasi Kallinen <paxed@alt.org>
Sat, 8 Oct 2016 10:57:43 +0000 (13:57 +0300)
Change via dNetHack.  Restrict heroes polymorphed into ghouls
so they can only eat non-vegan corpses and eggs.  This matches
more closely what pet ghouls prefer.

src/eat.c

index 1191a82923b971e65f051b8809ee1d987142104d..0caec93dd6f86b8e0d44872a357334db2343ef85 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -93,6 +93,12 @@ register struct obj *obj;
         && (youmonst.data != &mons[PM_RUST_MONSTER] || is_rustprone(obj)))
         return TRUE;
 
+    /* Ghouls only eat non-veggy corpses or eggs (see dogfood()) */
+    if (u.umonnum == PM_GHOUL)
+        return (boolean)((obj->otyp == CORPSE
+                          && !vegan(&mons[obj->corpsenm]))
+                         || (obj->otyp == EGG));
+
     if (u.umonnum == PM_GELATINOUS_CUBE && is_organic(obj)
         /* [g.cubes can eat containers and retain all contents
             as engulfed items, but poly'd player can't do that] */