OSDN Git Service

Detail activate description is dynamically built using activation_info table
[hengband/hengband.git] / src / generate.c
index 02e67f5..bf75742 100644 (file)
@@ -802,6 +802,8 @@ static bool cave_gen(void)
        /* Build some rooms */
        else
        {
+               int tunnel_fail_count = 0;
+
                /*
                 * Build each type of room in turn until we cannot build any more.
                 */
@@ -886,14 +888,16 @@ static bool cave_gen(void)
                        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++)
                        {
@@ -1184,8 +1188,17 @@ static void arena_gen(void)
 
        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
+       }
+
 }
 
 
@@ -1336,7 +1349,7 @@ static void quest_gen(void)
        /* 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);
 }