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

Function reveal_trap

src/muse.c:756–767  ·  view source on GitHub ↗

when a monster deliberately enters a trap, make sure the spot becomes accessible (trap doors and teleporters inside niches are located at secret corridor locations; convert such into normal corridor even if hero doesn't see it happen) */

Source from the content-addressed store, hash-verified

754 secret corridor locations; convert such into normal corridor even if
755 hero doesn't see it happen) */
756staticfn void
757reveal_trap(struct trap *t, boolean seeit)
758{
759 struct rm *lev = &levl[t->tx][t->ty];
760
761 if (lev->typ == SCORR) {
762 lev->typ = CORR, lev->flags = 0; /* set_levltyp(,,CORR) */
763 unblock_point(t->tx, t->ty);
764 }
765 if (seeit)
766 seetrap(t);
767}
768
769/* Monsters without the Amulet escape the dungeon and
770 * are gone for good when they leave up the up stairs.

Callers 1

use_defensiveFunction · 0.85

Calls 2

unblock_pointFunction · 0.85
seetrapFunction · 0.85

Tested by

no test coverage detected