/* Build some rooms */
else
{
+ int tunnel_fail_count = 0;
+
/*
* Build each type of room in turn until we cannot build any more.
*/
if (randint1(dun_level) > d_info[dungeon_type].tunnel_percent)
{
/* make cave-like tunnel */
- build_tunnel2(dun->cent[i].x, dun->cent[i].y, x, y, 2, 2);
+ (void)build_tunnel2(dun->cent[i].x, dun->cent[i].y, x, y, 2, 2);
}
else
{
/* make normal tunnel */
- build_tunnel(dun->cent[i].y, dun->cent[i].x, y, x);
+ if (!build_tunnel(dun->cent[i].y, dun->cent[i].x, y, x)) tunnel_fail_count++;
}
+ if (tunnel_fail_count >= 2) return FALSE;
+
/* Turn the tunnel into corridor */
for (j = 0; j < dun->tunn_n; j++)
{
build_arena();
- place_monster_aux(0, py + 5, px, arena_info[p_ptr->arena_number].r_idx,
- (PM_NO_KAGE | PM_NO_PET));
+ if(!place_monster_aux(0, py + 5, px, arena_info[p_ptr->arena_number].r_idx, (PM_NO_KAGE | PM_NO_PET)))
+ {
+ p_ptr->exit_bldg = TRUE;
+ p_ptr->arena_number++;
+#ifdef JP
+ msg_print("Áê¼ê¤Ï·ç¾ì¤·¤¿¡£¤¢¤Ê¤¿¤ÎÉÔÀᄀ¤À¡£");
+#else
+ msg_print("The enemy is unable appear. You won by default.");
+#endif
+ }
+
}
/* Prepare allocation table */
get_mon_num_prep(get_monster_hook(), NULL);
- init_flags = INIT_CREATE_DUNGEON | INIT_ASSIGN;
+ init_flags = INIT_CREATE_DUNGEON;
process_dungeon_file("q_info.txt", 0, 0, MAX_HGT, MAX_WID);
}