Monsters see and remember when others trigger traps
No longer will there be a conga line of hill orcs stepping into the same arrow trap one after another.
This commit is contained in:
@@ -1269,6 +1269,7 @@ m_move(register struct monst* mtmp, register int after)
|
||||
register struct obj *otmp;
|
||||
register coordxy xx, yy;
|
||||
coordxy oomx, oomy, lmx, lmy;
|
||||
struct trap *ttmp;
|
||||
|
||||
/* cut down the search radius if it thinks character is closer. */
|
||||
if (distmin(mtmp->mux, mtmp->muy, omx, omy) < SQSRCHRADIUS
|
||||
@@ -1321,6 +1322,16 @@ m_move(register struct monst* mtmp, register int after)
|
||||
|| (is_lava(xx, yy) && !likes_lava(ptr)))
|
||||
continue;
|
||||
|
||||
/* ignore obj if there's a trap and monster knows it */
|
||||
if ((ttmp = t_at(xx, yy)) != 0
|
||||
&& mon_knows_traps(mtmp, ttmp->ttyp)) {
|
||||
if (gx == xx && gy == yy) {
|
||||
gx = mtmp->mux;
|
||||
gy = mtmp->muy;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (((likegold && otmp->oclass == COIN_CLASS)
|
||||
|| (likeobjs && index(practical, otmp->oclass)
|
||||
&& (otmp->otyp != CORPSE
|
||||
|
||||
Reference in New Issue
Block a user