]> granicus.if.org Git - nethack/commitdiff
tainted meat did not invoke cannibalism
authornethack.allison <nethack.allison>
Sat, 6 Dec 2003 05:11:40 +0000 (05:11 +0000)
committernethack.allison <nethack.allison>
Sat, 6 Dec 2003 05:11:40 +0000 (05:11 +0000)
doc/fixes34.3
src/eat.c

index 519b47695a17c7319f93be3e1d223ef32fdf7947..58a78771cf6fcf5d7b36960a56de620fbdab7dfa 100644 (file)
@@ -101,6 +101,7 @@ attempting to drop a subset of a stack of multiple cursed loadstones could
        corrupt inventory or cause a crash
 "miss" message was missing for thrown or kicked gold not caught by a monster
 prevent recursive impossible() and panic() calls from leading to a stack overflow
+tainted meat didn't invoke cannibalism
 
 
 Platform- and/or Interface-Specific Fixes
index 3588b6b1a6ad21dcab5aa9f563845f608b0f670d..85b872e1cbd4c794a7d1a185aff1f789792924d0 100644 (file)
--- a/src/eat.c
+++ b/src/eat.c
@@ -37,12 +37,12 @@ STATIC_DCL void FDECL(accessory_has_effect, (struct obj *));
 STATIC_DCL void FDECL(fpostfx, (struct obj *));
 STATIC_DCL int NDECL(bite);
 STATIC_DCL int FDECL(edibility_prompts, (struct obj *));
-
 STATIC_DCL int FDECL(rottenfood, (struct obj *));
 STATIC_DCL void NDECL(eatspecial);
 STATIC_DCL void FDECL(eataccessory, (struct obj *));
 STATIC_DCL const char *FDECL(foodword, (struct obj *));
 STATIC_DCL int FDECL(tin_variety, (struct obj *));
+STATIC_DCL boolean FDECL(maybe_cannibal, (int,BOOLEAN_P));
 
 char msgbuf[BUFSZ];
 
@@ -411,18 +411,29 @@ boolean message;
        context.victual.fullwarn = context.victual.eating = context.victual.doreset = FALSE;
 }
 
-STATIC_OVL void
-cprefx(pm)
-register int pm;
+STATIC_OVL boolean
+maybe_cannibal(pm, allowmsg)
+int pm;
+boolean allowmsg;
 {
        if (!CANNIBAL_ALLOWED() && your_race(&mons[pm])) {
-               if (Upolyd)
-                       You("have a bad feeling deep inside.");
-               You("cannibal!  You will regret this!");
+               if (allowmsg) {
+                       if (Upolyd)
+                               You("have a bad feeling deep inside.");
+                       You("cannibal!  You will regret this!");
+               }
                HAggravate_monster |= FROMOUTSIDE;
                change_luck(-rn1(4,2));         /* -5..-2 */
+               return TRUE;
        }
+       return FALSE;
+}
 
+STATIC_OVL void
+cprefx(pm)
+register int pm;
+{
+       (void) maybe_cannibal(pm,TRUE);
        if (touch_petrifies(&mons[pm]) || pm == PM_MEDUSA) {
            if (!Stone_resistance &&
                !(poly_when_stoned(youmonst.data) && polymon(PM_STONE_GOLEM))) {
@@ -1288,9 +1299,11 @@ eatcorpse(otmp)          /* called when a corpse is selected as food */
        }
 
        if (mnum != PM_ACID_BLOB && !stoneable && rotted > 5L) {
-               pline("Ulch - that %s was tainted!",
+               boolean cannibal = maybe_cannibal(mnum, FALSE);
+               pline("Ulch - that %s was tainted%s!",
                      mons[mnum].mlet == S_FUNGUS ? "fungoid vegetation" :
-                     !vegetarian(&mons[mnum]) ? "meat" : "protoplasm");
+                     !vegetarian(&mons[mnum]) ? "meat" : "protoplasm",
+                     cannibal ? " cannibal" : "");
                if (Sick_resistance) {
                        pline("It doesn't seem at all sickening, though...");
                } else {