return TRUE if monster mtmp has another monster next to it. * Called from find_defensive() where it is limited to Is_knox() * only, otherwise you could trap two monsters next to each other * in a boulder fort, and they would be happy to stay in there. */
| 417 | * only, otherwise you could trap two monsters next to each other |
| 418 | * in a boulder fort, and they would be happy to stay in there. */ |
| 419 | staticfn boolean |
| 420 | m_next2m(struct monst *mtmp) |
| 421 | { |
| 422 | coordxy x, y; |
| 423 | struct monst *m2; |
| 424 | |
| 425 | if (DEADMONSTER(mtmp) || mon_offmap(mtmp)) |
| 426 | return FALSE; |
| 427 | |
| 428 | for (x = mtmp->mx - 1; x <= mtmp->mx + 1; x++) |
| 429 | for (y = mtmp->my - 1; y <= mtmp->my + 1; y++) { |
| 430 | if (!isok(x,y)) |
| 431 | continue; |
| 432 | if ((m2 = m_at(x, y)) && m2 != mtmp) |
| 433 | return TRUE; |
| 434 | } |
| 435 | return FALSE; |
| 436 | } |
| 437 | |
| 438 | /* Select a defensive item/action for a monster. Returns TRUE iff one is |
| 439 | found. */ |
no test coverage detected