From: nethack.allison Date: Sat, 25 Mar 2006 21:06:49 +0000 (+0000) Subject: prevent possible minor MAIL abuse X-Git-Tag: MOVE2GIT~1081 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05ce4481356ef71df5cfdb48691b128fbed7ff37;p=nethack prevent possible minor MAIL abuse wrote: > * MAIL Abuse: one can polymorph into a gelatinous cube, send themselves lots of > scrolls of mail, and eat them, gaining free nutrition. --- diff --git a/doc/fixes35.0 b/doc/fixes35.0 index becb1db13..cefb2cdae 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -129,6 +129,7 @@ prevent scroll of charging that has already disappeared from showing in the doors break instead of absorbing the blast of a broken wand of striking avoid "Something's in the way" message with unidentified wand of locking better handling for Fort Ludios and endgame in wizard mode's `^V ?' menu +no free lunch for gelatinous cubes including scrolls of mail Platform- and/or Interface-Specific Fixes diff --git a/src/eat.c b/src/eat.c index 01dca3648..15a4174c7 100644 --- a/src/eat.c +++ b/src/eat.c @@ -1902,6 +1902,12 @@ eatspecial() /* called after eating non-food */ useupf(otmp, otmp->quan); return; } +#ifdef MAIL + if (otmp->otyp == SCR_MAIL) { + /* no nutrition */ + pline("This junk mail is less than satisfying."); + } +#endif if (otmp->oclass == POTION_CLASS) { otmp->quan++; /* dopotion() does a useup() */ (void)dopotion(otmp); @@ -2179,7 +2185,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */ { register struct obj *otmp; int basenutrit; /* nutrition of full item */ - boolean dont_start = FALSE; + boolean dont_start = FALSE, nodelicious = FALSE; if (Strangled) { pline("If you can't breathe air, how can you consume solids?"); @@ -2263,6 +2269,12 @@ doeat() /* generic "eat" command funtion (see cmd.c) */ basenutrit = weight(otmp); /* oc_nutrition is usually weight anyway */ else basenutrit = objects[otmp->otyp].oc_nutrition; +#ifdef MAIL + if (otmp->otyp == SCR_MAIL) { + basenutrit = 0; + nodelicious = TRUE; + } +#endif context.victual.nmod = basenutrit; context.victual.eating = TRUE; /* needed for lesshungry() */ @@ -2285,7 +2297,7 @@ doeat() /* generic "eat" command funtion (see cmd.c) */ losehp(rnd(15), xname(otmp), KILLED_BY_AN); } else You("seem unaffected by the poison."); - } else if (!otmp->cursed) + } else if (!otmp->cursed && !nodelicious) pline("%s%s is delicious!", (obj_is_pname(otmp) && (otmp->oartifact < ART_ORB_OF_DETECTION)) ? "" : "This ",