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

Function transient_light_cleanup

src/light.c:329–357  ·  view source on GitHub ↗

delete any camera flash light sources and draw "remembered, unseen monster" glyph at locations where a monster was flagged for being visible during transient light movement but can't be seen now */

Source from the content-addressed store, hash-verified

327 monster" glyph at locations where a monster was flagged for being
328 visible during transient light movement but can't be seen now */
329void
330transient_light_cleanup(void)
331{
332 struct monst *mon;
333 int mtempcount;
334
335 /* in case we're cleaning up a camera flash, remove all object light
336 sources which aren't associated with a specific object */
337 discard_flashes();
338 if (gv.vision_full_recalc) /* set by del_light_source() */
339 vision_recalc(0);
340
341 /* for thrown/kicked candle or lamp or for camera flash, some
342 monsters may have been mapped in light which has now gone away
343 so need to be replaced by "remembered, unseen monster" glyph */
344 mtempcount = 0;
345 for (mon = fmon; mon; mon = mon->nmon) {
346 if (DEADMONSTER(mon))
347 continue;
348 if (mon->mtemplit) {
349 mon->mtemplit = 0;
350 ++mtempcount;
351 if (!canspotmon(mon))
352 map_invisible(mon->mx, mon->my);
353 }
354 }
355 if (mtempcount)
356 flush_screen(0);
357}
358
359/* camera flashes have Null object; caller wants to get rid of them now */
360staticfn void

Callers 3

msummonFunction · 0.85
bhitFunction · 0.85
do_blinding_rayFunction · 0.85

Calls 4

discard_flashesFunction · 0.85
vision_recalcFunction · 0.85
map_invisibleFunction · 0.85
flush_screenFunction · 0.85

Tested by

no test coverage detected