From 29ec41002d8c7937909c472d1f2e2b5152f8148c Mon Sep 17 00:00:00 2001 From: Hourier Date: Thu, 20 Aug 2020 19:29:34 +0900 Subject: [PATCH] [Refactor] #40577 Moved set_floor() from floor.c/h to space-finder.c --- src/floor/floor.c | 22 ---------------------- src/floor/floor.h | 1 - src/room/space-finder.c | 21 ++++++++++++++++++++- 3 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/floor/floor.c b/src/floor/floor.c index 26a6576f2..c0e4c037b 100644 --- a/src/floor/floor.c +++ b/src/floor/floor.c @@ -166,28 +166,6 @@ void wipe_o_list(floor_type *floor_ptr) floor_ptr->o_cnt = 0; } -/*! - * @brief 指定のマスを床地形に変える / Set a square to be floor. (Includes range checking.) - * @param player_ptr プレーヤーへの参照ポインタ - * @param x 地形を変えたいマスのX座標 - * @param y 地形を変えたいマスのY座標 - * @return なし - */ -void set_floor(player_type *player_ptr, POSITION x, POSITION y) -{ - floor_type *floor_ptr = player_ptr->current_floor_ptr; - if (!in_bounds(floor_ptr, y, x)) { - return; - } - - if (floor_ptr->grid_array[y][x].info & CAVE_ROOM) { - return; - } - - if (is_extra_bold(floor_ptr, y, x)) - place_bold(player_ptr, y, x, GB_FLOOR); -} - /* * Standard "find me a location" function * diff --git a/src/floor/floor.h b/src/floor/floor.h index a6a14513b..5faa1b63c 100644 --- a/src/floor/floor.h +++ b/src/floor/floor.h @@ -7,5 +7,4 @@ extern floor_type floor_info; void update_smell(floor_type *floor_ptr, player_type *subject_ptr); void forget_flow(floor_type *floor_ptr); void wipe_o_list(floor_type *floor_ptr); -void set_floor(player_type *player_ptr, POSITION x, POSITION y); void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode); diff --git a/src/room/space-finder.c b/src/room/space-finder.c index 79729c794..406030819 100644 --- a/src/room/space-finder.c +++ b/src/room/space-finder.c @@ -2,7 +2,6 @@ #include "dungeon/dungeon-flag-types.h" #include "dungeon/dungeon.h" #include "floor/cave.h" -#include "floor/floor.h" #include "grid/grid.h" #include "system/dungeon-data-definition.h" #include "system/floor-type-definition.h" @@ -26,6 +25,26 @@ static bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y) } /*! + * @brief 指定のマスを床地形に変える / Set a square to be floor. (Includes range checking.) + * @param player_ptr プレーヤーへの参照ポインタ + * @param x 地形を変えたいマスのX座標 + * @param y 地形を変えたいマスのY座標 + * @return なし + */ +static void set_floor(player_type *player_ptr, POSITION x, POSITION y) +{ + floor_type *floor_ptr = player_ptr->current_floor_ptr; + if (!in_bounds(floor_ptr, y, x)) + return; + + if (floor_ptr->grid_array[y][x].info & CAVE_ROOM) + return; + + if (is_extra_bold(floor_ptr, y, x)) + place_bold(player_ptr, y, x, GB_FLOOR); +} + +/*! * @brief * 指定範囲に通路が通っていることを確認した上で床で埋める * This function tunnels around a room if it will cut off part of a grid system. -- 2.11.0