diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 5c3478a99..d11b215f1 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1097,6 +1097,7 @@ fix bug making random subrooms never touching the right or bottom if a grave is created with the corpse lying on top (bones), don't find a corpse or release a zombie or mummy when digging it up kicking a headstone might summon a ghoul +eating garlic makes nearby monsters flee Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/eat.c b/src/eat.c index d593d7211..e58b93002 100644 --- a/src/eat.c +++ b/src/eat.c @@ -28,6 +28,7 @@ static void consume_tin(const char *); static void start_tin(struct obj *); static int eatcorpse(struct obj *); static void start_eating(struct obj *, boolean); +static void garlic_breath(struct monst *); static void fprefx(struct obj *); static void fpostfx(struct obj *); static int bite(void); @@ -1972,6 +1973,14 @@ eating_glob(struct obj *glob) return (go.occupation == eatfood && glob == gc.context.victual.piece); } +/* scare nearby monster when hero eats garlic */ +static void +garlic_breath(struct monst *mtmp) +{ + if (olfaction(mtmp->data) && distu(mtmp->mx, mtmp->my) < 7) + monflee(mtmp, 0, FALSE, FALSE); +} + /* * Called on "first bite" of (non-corpse) food, after touchfood() has * marked it 'partly eaten'. Used for non-rotten non-tin non-corpse food. @@ -2030,6 +2039,7 @@ fprefx(struct obj *otmp) make_vomiting((long) rn1(gc.context.victual.reqtime, 5), FALSE); break; } + iter_mons(garlic_breath); /*FALLTHRU*/ default: if (otmp->otyp == SLIME_MOLD && !otmp->cursed