OSDN Git Service

[Refactor] 2軒目以降のブラックマーケットを生成しないようにするコードを削除
authorHabu <habu1010+github@gmail.com>
Sat, 21 Aug 2021 05:12:18 +0000 (14:12 +0900)
committerHabu <habu1010+github@gmail.com>
Sat, 21 Aug 2021 05:12:18 +0000 (14:12 +0900)
今後とも地下街を同一フロアに2つ以上生成する事はなさそうなので、
ブラックマーケットが2軒生成される事は無いと判断し当該コードを削除する。

src/room/rooms-city.cpp

index 19e2ec8..2986fd9 100644 (file)
@@ -187,26 +187,9 @@ bool build_type16(player_type *player_ptr, dun_data_type *dd_ptr)
         STORE_BOOK,
     };
     int n = sizeof stores / sizeof(int);
-    POSITION i, y, x, y1, x1, yval, xval;
+    POSITION y1, x1, yval, xval;
     int town_hgt = rand_range(MIN_TOWN_HGT, MAX_TOWN_HGT);
     int town_wid = rand_range(MIN_TOWN_WID, MAX_TOWN_WID);
-    bool prevent_bm = false;
-    floor_type *floor_ptr = player_ptr->current_floor_ptr;
-
-    // If already exist black market, prevent building
-    for (y = 0; (y < floor_ptr->height) && !prevent_bm; y++) {
-        for (x = 0; x < floor_ptr->width; x++) {
-            const auto f_ptr = &f_info[floor_ptr->grid_array[y][x].feat];
-            if (f_ptr->flags.has(FF::STORE) && f_ptr->subtype == STORE_BLACK) {
-                prevent_bm = true;
-                break;
-            }
-        }
-    }
-
-    for (i = 0; i < n; i++)
-        if ((stores[i] == STORE_BLACK) && prevent_bm)
-            stores[i] = stores[--n];
 
     if (!n)
         return false;