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

Function bound_digging

src/mkmaze.c:1440–1461  ·  view source on GitHub ↗

put a non-diggable/non-phaseable boundary around the initial portion * of a level map. assumes that no level will initially put things * beyond the isok() range. * * we can't bound unconditionally on the last line with something in it, * because that something might be a niche which was already reachable, * so the boundary would be breached * * we can't bound unconditionally on one beyond

Source from the content-addressed store, hash-verified

1438 * that provides a window of abuse for wallified special levels
1439 */
1440void
1441bound_digging(void)
1442{
1443 coordxy x, y;
1444 coordxy xmin, xmax, ymin, ymax;
1445
1446 if (Is_earthlevel(&u.uz))
1447 return; /* everything diggable here */
1448
1449 get_level_extends(&xmin, &ymin, &xmax, &ymax);
1450
1451 for (x = 0; x < COLNO; x++)
1452 for (y = 0; y < ROWNO; y++)
1453 if (IS_STWALL(levl[x][y].typ)) {
1454 /* undiggable walls at edges, ... */
1455 if (y <= ymin || y >= ymax || x <= xmin || x >= xmax)
1456 levl[x][y].wall_info |= W_NONDIGGABLE;
1457 /* one tile past that, everything is also unphaseable */
1458 if (y < ymin || y > ymax || x < xmin || x > xmax)
1459 levl[x][y].wall_info |= W_NONPASSWALL;
1460 }
1461}
1462
1463void
1464mkportal(coordxy x, coordxy y, xint16 todnum, xint16 todlevel)

Callers 1

level_finalize_topologyFunction · 0.85

Calls 1

get_level_extendsFunction · 0.85

Tested by

no test coverage detected