* 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(). */
| 406 | * invisible monster notation, we might have to call newsym(). |
| 407 | */ |
| 408 | void |
| 409 | unmap_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() |
no test coverage detected