MCPcopy Create free account
hub / github.com/NetHack/NetHack / maybe_unhide_at

Function maybe_unhide_at

src/mon.c:4697–4720  ·  view source on GitHub ↗

reveal a hiding monster at x,y, either under nonexistent object, or an eel out of water. */

Source from the content-addressed store, hash-verified

4695/* reveal a hiding monster at x,y, either under nonexistent object,
4696 or an eel out of water. */
4697void
4698maybe_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

Callers 15

rloc_to_coreFunction · 0.85
unplacebc_coreFunction · 0.85
move_bcFunction · 0.85
movobjFunction · 0.85
burn_objectFunction · 0.85
bury_objsFunction · 0.85
delobj_coreFunction · 0.85
shrinking_glob_goneFunction · 0.85
obj_meldFunction · 0.85
launch_objFunction · 0.85
mintrapFunction · 0.85
bhitoFunction · 0.85

Calls 3

can_hide_under_objFunction · 0.85
is_poolFunction · 0.85
hideunderFunction · 0.85

Tested by

no test coverage detected