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

Function set_lit

src/read.c:2470–2488  ·  view source on GitHub ↗

* Low-level lit-field update routine. */

Source from the content-addressed store, hash-verified

2468 * Low-level lit-field update routine.
2469 */
2470staticfn void
2471set_lit(coordxy x, coordxy y, genericptr_t val)
2472{
2473 struct monst *mtmp;
2474 struct litmon *gremlin;
2475
2476 if (val) {
2477 levl[x][y].lit = 1;
2478 if ((mtmp = m_at(x, y)) != 0 && mtmp->data == &mons[PM_GREMLIN]) {
2479 gremlin = (struct litmon *) alloc(sizeof *gremlin);
2480 gremlin->mon = mtmp;
2481 gremlin->nxt = gremlins;
2482 gremlins = gremlin;
2483 }
2484 } else {
2485 levl[x][y].lit = 0;
2486 snuff_light_source(x, y);
2487 }
2488}
2489
2490void
2491litroom(

Callers 1

litroomFunction · 0.85

Calls 2

snuff_light_sourceFunction · 0.85
allocFunction · 0.70

Tested by

no test coverage detected