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

Function block_point

src/vision.c:864–891  ·  view source on GitHub ↗

* block_point() * * Make the location opaque to light. */

Source from the content-addressed store, hash-verified

862 * Make the location opaque to light.
863 */
864void
865block_point(int x, int y)
866{
867#ifdef DEBUG
868 /* set DEBUGFILES=seethru in environment to see through clouds & water */
869 if (gs.seethru == 0) { /* init once */
870 gs.seethru = (wizard && explicitdebug("seethru")) ? 1 : -1;
871 }
872 if (gs.seethru == 1) {
873 if (!does_block(x, y, &levl[x][y]))
874 return;
875 }
876#endif
877
878 fill_point(y, x);
879
880 /* recalc light sources here? */
881
882 /*
883 * We have to do a full vision recalculation if we "could see" the
884 * location. Why? Suppose some monster opened a way so that the
885 * hero could see a lit room. However, the position of the opening
886 * was out of night-vision range of the hero. Suddenly the hero should
887 * see the lit room.
888 */
889 if (gv.viz_array[y][x])
890 gv.vision_full_recalc = 1;
891}
892
893/*
894 * unblock_point()

Callers 15

recalc_block_pointFunction · 0.85
still_chewingFunction · 0.85
add_regionFunction · 0.85
docloseFunction · 0.85
doorlockFunction · 0.85
wallify_vaultFunction · 0.85
mimic_light_blockingFunction · 0.85
place_objectFunction · 0.85
set_mimic_symFunction · 0.85
poly_objFunction · 0.85
movebubblesFunction · 0.85
mv_bubbleFunction · 0.85

Calls 1

fill_pointFunction · 0.85

Tested by

no test coverage detected