MCPcopy Index your code
hub / github.com/NetHack/NetHack / unmap_object

Function unmap_object

src/display.c:408–438  ·  view source on GitHub ↗

* unmap_object() * * Remove something from the map when the hero realizes it's not there * anymore. Replace it with background or known trap, but not with * any other remembered object. If this is used for detection, a full * screen update is imminent anyway; if this is used to get rid of an * invisible monster notation, we might have to call newsym(). */

Source from the content-addressed store, hash-verified

406 * invisible monster notation, we might have to call newsym().
407 */
408void
409unmap_object(coordxy x, coordxy y)
410{
411 struct trap *trap;
412 struct engr *ep;
413
414 if (!svl.level.flags.hero_memory)
415 return;
416
417 if ((trap = t_at(x, y)) != 0 && trap->tseen && !covers_traps(x, y)) {
418 map_trap(trap, 0);
419 } else if (levl[x][y].seenv) {
420 struct rm *lev = &levl[x][y];
421
422 if (spot_shows_engravings(x, y)
423 && (ep = engr_at(x, y)) != 0 && !covers_traps(x, y)) {
424 if (cansee(x, y))
425 ep->erevealed = 1;
426 map_engraving(ep, 0);
427 } else {
428 map_background(x, y, 0);
429 }
430
431 /* turn remembered dark room squares dark */
432 if (!lev->waslit && lev->glyph == cmap_to_glyph(S_room)
433 && lev->typ == ROOM)
434 lev->glyph = cmap_to_glyph(S_stone);
435 } else {
436 levl[x][y].glyph = cmap_to_glyph(S_stone); /* default val */
437 }
438}
439
440/*
441 * map_location()

Callers 9

clear_stale_mapFunction · 0.85
dopushFunction · 0.85
domove_fight_emptyFunction · 0.85
unmap_invisibleFunction · 0.85
show_mon_or_warnFunction · 0.85
mondeadFunction · 0.85
monstoneFunction · 0.85
bhitFunction · 0.85

Calls 5

t_atFunction · 0.85
map_trapFunction · 0.85
engr_atFunction · 0.85
map_engravingFunction · 0.85
map_backgroundFunction · 0.85

Tested by

no test coverage detected