Skip to content

Commit

Permalink
re-fix #H1371 - dead monster fleeing
Browse files Browse the repository at this point in the history
     From a bug report, a monster which
died by moving into a trap which was next to the hero standing on Elbereth
resulted in "The <mon> is killed!  The <mon> turns to flee!".  An earlier
change made monflee() return if it's given a dead monster, so the fleeing
message is no longer given.  This fixes the place where monflee() was
inappropriately being called for a dead monster in the reported situation.
  • Loading branch information
nethack.rankin committed Aug 20, 2007
1 parent 6bf7c5a commit 86fccb4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions doc/fixes34.4
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ grammar of messages regarding eating artifacts
avoid a message about an invisible monster looking much better
player polymorphed as a xorn could not pick up items in pits
don't display "turns to flee" message for a mimicing mimic
don't display "turns to flee" message for a monster who has just died
dipping acid in a fountain could cause an explosion but not destroy the potion
if your blindfold glows and you're not otherwise blinded, you can see it
added strsubst() to hacklib
Expand Down
7 changes: 4 additions & 3 deletions src/monmove.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* SCCS Id: @(#)monmove.c 3.5 2007/05/16 */
/* SCCS Id: @(#)monmove.c 3.5 2007/08/19 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */

Expand Down Expand Up @@ -252,7 +252,7 @@ boolean fleemsg;
}

STATIC_OVL void
distfleeck(mtmp,inrange,nearby,scared)
distfleeck(mtmp, inrange, nearby, scared)
register struct monst *mtmp;
int *inrange, *nearby, *scared;
{
Expand Down Expand Up @@ -531,7 +531,8 @@ register struct monst *mtmp;
}

tmp = m_move(mtmp, 0);
distfleeck(mtmp,&inrange,&nearby,&scared); /* recalc */
if (tmp != 2)
distfleeck(mtmp, &inrange, &nearby, &scared); /* recalc */

switch (tmp) {
case 0: /* no movement, but it can still attack you */
Expand Down

0 comments on commit 86fccb4

Please sign in to comment.