fix #Q241 - swallowing Medusa (trunk only)

From a bug report, eating Medusa's corpse is fatal
but devouring her whole (purple worm or poly'd hero) was not.  Now it will
be.  Also, being killed by swallowing a cockatrice or a Rider could have
disclosed "you went without food" if you hadn't eaten anything else prior.
This fixes that too, although it might be a little silly if it happens to
a monk since he'll feel guilty (for non-vegetarian diet) right as he dies.
This commit is contained in:
nethack.rankin
2005-12-03 03:16:25 +00:00
parent c28a4aece8
commit 6955f1ab63
3 changed files with 46 additions and 33 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)mhitm.c 3.5 2005/09/27 */
/* SCCS Id: @(#)mhitm.c 3.5 2005/12/02 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -698,7 +698,9 @@ mdamagem(magr, mdef, mattk)
res = MM_MISS;
boolean cancelled;
if (touch_petrifies(pd) && !resists_ston(magr)) {
if ((touch_petrifies(pd) || /* or flesh_petrifies() */
(mattk->adtyp == AD_DGST && pd == &mons[PM_MEDUSA])) &&
!resists_ston(magr)) {
long protector = attk_protection((int)mattk->aatyp),
wornitems = magr->misc_worn_check;
@@ -1509,4 +1511,3 @@ int aatyp;
}
/*mhitm.c*/