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

Function premap_detect

src/detect.c:2133–2159  ·  view source on GitHub ↗

Pre-map (the sokoban) levels */

Source from the content-addressed store, hash-verified

2131
2132/* Pre-map (the sokoban) levels */
2133void
2134premap_detect(void)
2135{
2136 coordxy x, y;
2137 struct trap *ttmp;
2138 struct obj *obj;
2139
2140 /* Map the background and boulders */
2141 for (x = 1; x < COLNO; x++)
2142 for (y = 0; y < ROWNO; y++) {
2143 if (skip_premap_detect(x, y))
2144 continue;
2145 levl[x][y].seenv = SVALL;
2146 levl[x][y].waslit = TRUE;
2147 if (levl[x][y].typ == SDOOR)
2148 levl[x][y].wall_info = 0; /* see rm.h for explanation */
2149 map_background(x, y, 1);
2150 if ((obj = sobj_at(BOULDER, x, y)) != 0)
2151 map_object(obj, 1);
2152 }
2153
2154 /* Map the traps */
2155 for (ttmp = gf.ftrap; ttmp; ttmp = ttmp->ntrap) {
2156 ttmp->tseen = 1;
2157 map_trap(ttmp, 1);
2158 }
2159}
2160
2161/* used to see under visible gas/cloud regions; caller must declare cmaptmp */
2162#define glyph_is_gascloud(glyph) \

Callers 2

lspo_finalize_levelFunction · 0.85
load_specialFunction · 0.85

Calls 5

skip_premap_detectFunction · 0.85
map_backgroundFunction · 0.85
sobj_atFunction · 0.85
map_objectFunction · 0.85
map_trapFunction · 0.85

Tested by

no test coverage detected