- int i, j, k, y, x, y1, x1;
-
- int max_vault_ok = 2;
-
- int feat1 = 0, feat2 = 0;
-
- cave_type *c_ptr;
-
- bool destroyed = FALSE;
- bool empty_level = FALSE;
- bool cavern = FALSE;
- int laketype = 0;
-
-
- dun_data dun_body;
-
- /* Fill the arrays of floors and walls in the good proportions */
- set_floor_and_wall(dungeon_type);
-
-
- /* Prepare allocation table */
- get_mon_num_prep(get_monster_hook(), NULL);
-
- feat_wall_outer = d_info[dungeon_type].outer_wall;
- feat_wall_inner = d_info[dungeon_type].inner_wall;
- feat_wall_solid = d_info[dungeon_type].outer_wall;
-
- /* Global data */
- dun = &dun_body;
-
- if (cur_hgt <= SCREEN_HGT / 2 - 2) max_vault_ok--;
- if (cur_wid <= SCREEN_WID / 2 - 2) max_vault_ok--;
-
- /* Randomize the dungeon creation values */
- dun_rooms = rand_range(DUN_ROOMS_MIN, DUN_ROOMS_MAX);
- dun_tun_rnd = rand_range(DUN_TUN_RND_MIN, DUN_TUN_RND_MAX);
- dun_tun_chg = rand_range(DUN_TUN_CHG_MIN, DUN_TUN_CHG_MAX);
- dun_tun_con = rand_range(DUN_TUN_CON_MIN, DUN_TUN_CON_MAX);
- dun_tun_pen = rand_range(DUN_TUN_PEN_MIN, DUN_TUN_PEN_MAX);
- dun_tun_jct = rand_range(DUN_TUN_JCT_MIN, DUN_TUN_JCT_MAX);
-
- /* Actual maximum number of rooms on this level */
- dun->row_rooms = cur_hgt / BLOCK_HGT;
- dun->col_rooms = cur_wid / BLOCK_WID;
-
- /* Initialize the room table */
- for (y = 0; y < dun->row_rooms; y++)