OSDN Git Service

[Refactor] #38997 cave_clean_bold() に floor_type * 引数を追加. / Add floor_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Tue, 12 Nov 2019 01:14:14 +0000 (10:14 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 12 Nov 2019 01:14:14 +0000 (10:14 +0900)
src/floor.h
src/spells-floor.c
src/trap.c

index bb1d630..2165a3d 100644 (file)
@@ -236,10 +236,10 @@ extern floor_type floor_info;
  * Line 2 -- forbid object terrains
  * Line 3 -- forbid normal objects
  */
-#define cave_clean_bold(Y,X) \
+#define cave_clean_bold(F,Y,X) \
        (cave_have_flag_bold((Y), (X), FF_FLOOR) && \
-        !(p_ptr->current_floor_ptr->grid_array[Y][X].info & CAVE_OBJECT) && \
-         (p_ptr->current_floor_ptr->grid_array[Y][X].o_idx == 0))
+        !((F)->grid_array[Y][X].info & CAVE_OBJECT) && \
+         ((F)->grid_array[Y][X].o_idx == 0))
 
 
 /*
@@ -287,7 +287,7 @@ extern floor_type floor_info;
  * Line 3 -- forbid the player
  */
 #define cave_naked_bold(Y,X) \
-       (cave_clean_bold(Y,X) && \
+       (cave_clean_bold(p_ptr->current_floor_ptr, Y,X) && \
         !(p_ptr->current_floor_ptr->grid_array[Y][X].m_idx) && \
         !player_bold(p_ptr, Y,X))
 
index 181bf3e..d16272a 100644 (file)
@@ -192,7 +192,7 @@ void wiz_dark(player_type *caster_ptr)
  */
 bool warding_glyph(player_type *caster_ptr)
 {
-       if (!cave_clean_bold(caster_ptr->y, caster_ptr->x))
+       if (!cave_clean_bold(p_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x))
        {
                msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
                return FALSE;
@@ -216,7 +216,7 @@ bool warding_glyph(player_type *caster_ptr)
  */
 bool explosive_rune(floor_type *floor_ptr, POSITION y, POSITION x)
 {
-       if (!cave_clean_bold(y, x))
+       if (!cave_clean_bold(p_ptr->current_floor_ptr, y, x))
        {
                msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
                return FALSE;
@@ -238,7 +238,7 @@ bool explosive_rune(floor_type *floor_ptr, POSITION y, POSITION x)
  */
 bool place_mirror(player_type *caster_ptr)
 {
-       if (!cave_clean_bold(caster_ptr->y, caster_ptr->x))
+       if (!cave_clean_bold(p_ptr->current_floor_ptr, caster_ptr->y, caster_ptr->x))
        {
                msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
                return FALSE;
index 63358cd..fb89f05 100644 (file)
@@ -213,7 +213,7 @@ void place_trap(POSITION y, POSITION x)
        if (!in_bounds(p_ptr->current_floor_ptr, y, x)) return;
 
        /* Require empty, clean, floor grid */
-       if (!cave_clean_bold(y, x)) return;
+       if (!cave_clean_bold(p_ptr->current_floor_ptr, y, x)) return;
 
        /* Place an invisible trap */
        g_ptr->mimic = g_ptr->feat;