OSDN Git Service

[Refactor] #38997 in_bounds2u() に floor_type * 引数を追加. / Add floor_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sat, 21 Sep 2019 09:14:56 +0000 (18:14 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 21 Sep 2019 09:42:35 +0000 (18:42 +0900)
src/floor.h
src/spells1.c

index d633bb9..d6e5bb4 100644 (file)
@@ -184,8 +184,8 @@ extern floor_type floor_info;
  * Determines if a map location is on or inside the outer walls
  * (unsigned version)
  */
-#define in_bounds2u(Y,X) \
-   (((Y) < p_ptr->current_floor_ptr->height) && ((X) < p_ptr->current_floor_ptr->width))
+#define in_bounds2u(F,Y,X) \
+   (((Y) < (F)->height) && ((X) < (F)->width))
 
 
 /*
index 032cc42..fab5417 100644 (file)
@@ -4055,7 +4055,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
                                t_x = p_ptr->current_floor_ptr->m_list[who].fx - 1 + randint1(3);
                                max_attempts--;
                        }
-                       while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
+                       while (max_attempts && in_bounds2u(p_ptr->current_floor_ptr, t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
 
                        if (max_attempts < 1)
                        {
@@ -6357,7 +6357,7 @@ bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT da
                                                t_x = x_saver - 1 + randint1(3);
                                                max_attempts--;
                                        }
-                                       while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
+                                       while (max_attempts && in_bounds2u(p_ptr->current_floor_ptr, t_y, t_x) && !projectable(y, x, t_y, t_x));
 
                                        if (max_attempts < 1)
                                        {