OSDN Git Service

ironman_rooms適用時には最初の部屋を必ず通常の部屋にすることにより, 川
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 26 Dec 2003 19:00:35 +0000 (19:00 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 26 Dec 2003 19:00:35 +0000 (19:00 +0000)
や*破壊*が生成されるのを待たなくとも狭い階でのプレイヤー配置をしやす
いように変更. また, alloc_stairs()ではwalls == 0で階段配置に失敗した
ら失敗を返し, アイテムで埋まった階で無限ループに陥らないように修正.

src/generate.c
src/rooms.c

index 1bf46e7..96ef778 100644 (file)
@@ -188,7 +188,7 @@ static bool alloc_stairs(int feat, int num, int walls)
        for (i = 0; i < num; i++)
        {
                /* Try several times */
-               for (flag = FALSE; !flag)
+               for (flag = FALSE; !flag && (walls >= 0); walls--)
                {
                        /* Try several times, then decrease "walls" */
                        for (j = 0; j <= 3000; j++)
@@ -218,8 +218,9 @@ static bool alloc_stairs(int feat, int num, int walls)
                        }
 
                        /* Require fewer walls */
-                       if (walls) walls--;
                }
+
+               if (!flag) return FALSE;
        }
        return TRUE;
 }
index ad2ab45..004ab85 100644 (file)
@@ -5980,6 +5980,8 @@ bool generate_rooms(void)
        /* Assume normal cave */
        room_info_type *room_info_ptr = room_info_normal;
 
+       bool greater_vault_only = FALSE;
+
        /*
         * Initialize probability list.
         */
@@ -6008,6 +6010,8 @@ bool generate_rooms(void)
                        if (i == ROOM_T_GREATER_VAULT) prob_list[i] = 1;
                        else prob_list[i] = 0;
                }
+
+               greater_vault_only = TRUE;
        }
 
        /* Forbidden vaults */
@@ -6092,6 +6096,13 @@ bool generate_rooms(void)
                }
        }
 
+       if (greater_vault_only)
+       {
+               /* Increase the room built count. */
+               if (room_build(ROOM_T_NORMAL)) rooms_built++;
+               else return FALSE;
+       }
+
        /*
         * Build each type of room one by one until we cannot build any more.
         * [from SAngband (originally from OAngband)]