From: nethack.rankin Date: Sat, 27 May 2006 03:58:35 +0000 (+0000) Subject: more hiding monsters vs traps (trunk only) X-Git-Tag: MOVE2GIT~999 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7190f5a497c7ab11ff3a446d3f52d2434c89d204;p=nethack more hiding monsters vs traps (trunk only) Previous patch only handled hides-under monsters and the hero; this takes care of other hiding monsters. --- diff --git a/src/mon.c b/src/mon.c index 2931bacbb..f8f917c33 100644 --- a/src/mon.c +++ b/src/mon.c @@ -2344,8 +2344,13 @@ STATIC_OVL boolean restrap(mtmp) register struct monst *mtmp; { + struct trap *t; + if((mtmp->cham >= LOW_PM) || mtmp->mcan || mtmp->m_ap_type || cansee(mtmp->mx, mtmp->my) || rn2(3) || (mtmp == u.ustuck) || + /* can't hide while trapped except in pits */ + (mtmp->mtrapped && (t = t_at(mtmp->mx, mtmp->my)) != 0 && + !(t->ttyp == PIT || t->ttyp == SPIKED_PIT)) || (sensemon(mtmp) && distu(mtmp->mx, mtmp->my) <= 2)) return(FALSE);