static void FDECL(migr_booty_item, (int, const char *));
static void FDECL(migrate_orc, (struct monst *, unsigned long));
static void NDECL(stolen_booty);
+static void FDECL(get_level_extends, (int *, int *, int *, int *));
/* adjust a coordinate one step in the specified direction */
#define mz_move(X, Y, dir) \
return;
}
-/* put a non-diggable 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 the last line, because
- * that provides a window of abuse for wallified special levels
- */
-void
-bound_digging()
+static void
+get_level_extends(left, top, right, bottom)
+int *left, *top, *right, *bottom;
{
int x, y;
unsigned typ;
boolean found, nonwall;
int xmin, xmax, ymin, ymax;
- if (Is_earthlevel(&u.uz))
- return; /* everything diggable here */
-
found = nonwall = FALSE;
for (xmin = 0; !found && xmin <= COLNO; xmin++) {
lev = &levl[xmin][0];
}
ymax += (nonwall || !g.level.flags.is_maze_lev) ? 2 : 1;
+ *left = xmin;
+ *right = xmax;
+ *top = ymin;
+ *bottom = ymax;
+}
+
+/* put a non-diggable 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 the last line, because
+ * that provides a window of abuse for wallified special levels
+ */
+void
+bound_digging()
+{
+ int x, y;
+ int xmin, xmax, ymin, ymax;
+
+ if (Is_earthlevel(&u.uz))
+ return; /* everything diggable here */
+
+ get_level_extends(&xmin, &ymin, &xmax, &ymax);
+
for (x = 0; x < COLNO; x++)
for (y = 0; y < ROWNO; y++)
- if (y <= ymin || y >= ymax || x <= xmin || x >= xmax) {
-#ifdef DCC30_BUG
- lev = &levl[x][y];
- lev->wall_info |= W_NONDIGGABLE;
-#else
+ if (y <= ymin || y >= ymax || x <= xmin || x >= xmax)
levl[x][y].wall_info |= W_NONDIGGABLE;
-#endif
- }
}
void