OSDN Git Service

greater vault の配置で、外壁の永久岩にぴったり沿ってしまって、
authormogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 20 Dec 2002 05:22:26 +0000 (05:22 +0000)
committermogami <mogami@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 20 Dec 2002 05:22:26 +0000 (05:22 +0000)
入口が塞がれる事があるのを修正。上下左右に1ブロック余裕を取るようにした。

src/rooms.c

index df95682..279a3e4 100644 (file)
@@ -2626,8 +2626,13 @@ static void build_type8(int by0, int bx0)
                yoffset = 0;
        }
 
-       /* Try to allocate space for room.  If fails, exit */
-       if (!room_alloc(abs(x), abs(y), FALSE, by0, bx0, &xval, &yval)) return;
+       /*
+        * Try to allocate space for room.  If fails, exit
+        *
+        * Hack -- Prepare a bit larger space (+2, +2) to 
+        * prevent generation of vaults with no-entrance.
+        */
+       if (!room_alloc(abs(x) + 2, abs(y) + 2, FALSE, by0, bx0, &xval, &yval)) return;
 
        if (dummy >= SAFE_MAX_ATTEMPTS)
        {