reveal a hiding monster at x,y, either under nonexistent object, or an eel out of water. */
| 4695 | /* reveal a hiding monster at x,y, either under nonexistent object, |
| 4696 | or an eel out of water. */ |
| 4697 | void |
| 4698 | maybe_unhide_at(coordxy x, coordxy y) |
| 4699 | { |
| 4700 | struct monst *mtmp; |
| 4701 | boolean undetected = FALSE, trapped = FALSE; |
| 4702 | |
| 4703 | if ((mtmp = m_at(x, y)) != (struct monst *) 0) { |
| 4704 | undetected = mtmp->mundetected; |
| 4705 | trapped = mtmp->mtrapped; |
| 4706 | } else if (u_at(x, y)) { |
| 4707 | mtmp = &gy.youmonst; |
| 4708 | undetected = u.uundetected; |
| 4709 | trapped = u.utrap; |
| 4710 | } else { |
| 4711 | return; |
| 4712 | } |
| 4713 | |
| 4714 | if (undetected |
| 4715 | && ((hides_under(mtmp->data) |
| 4716 | && (!OBJ_AT(x, y) || trapped |
| 4717 | || !can_hide_under_obj(svl.level.objects[x][y]))) |
| 4718 | || (mtmp->data->mlet == S_EEL && !is_pool(x, y)))) |
| 4719 | (void) hideunder(mtmp); |
| 4720 | } |
| 4721 | |
| 4722 | /* monster/hero tries to hide under something at the current location; |
| 4723 | if used by monster creation, should only happen during level |
no test coverage detected