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

Function blackout

src/vault.c:122–141  ·  view source on GitHub ↗

as a temporary corridor is removed, set stone locations and adjacent spots to unlit; if player used scroll/wand/spell of light while inside the corridor, we don't want the light to reappear if/when a new tunnel goes through the same area */

Source from the content-addressed store, hash-verified

120 the corridor, we don't want the light to reappear if/when a new tunnel
121 goes through the same area */
122staticfn void
123blackout(coordxy x, coordxy y)
124{
125 struct rm *lev;
126 int i, j;
127
128 for (i = x - 1; i <= x + 1; ++i)
129 for (j = y - 1; j <= y + 1; ++j) {
130 if (!isok(i, j))
131 continue;
132 lev = &levl[i][j];
133 /* [possible bug: when (i != x || j != y), perhaps we ought
134 to check whether the spot on the far side is lit instead
135 of doing a blanket blackout of adjacent locations] */
136 if (lev->typ == STONE)
137 lev->lit = lev->waslit = 0;
138 /* mark <i,j> as not having been seen from <x,y> */
139 unset_seenv(lev, x, y, i, j);
140 }
141}
142
143staticfn void
144restfakecorr(struct monst *grd)

Callers 1

clear_fcorrFunction · 0.85

Calls 2

isokFunction · 0.85
unset_seenvFunction · 0.85

Tested by

no test coverage detected