OSDN Git Service

[Refactor] #38997 cave_stop_disintegration() に player_type * 引数を追加. / Add player_type...
authordeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 06:58:14 +0000 (15:58 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 4 Jan 2020 06:58:14 +0000 (15:58 +0900)
src/floor.c
src/floor.h
src/mspells2.c
src/spells1.c
src/spells2.c

index 87bd766..4e59a7c 100644 (file)
@@ -1373,7 +1373,7 @@ sint project_path(floor_type *floor_ptr, u16b *gp, POSITION range, POSITION y1,
 
                        if (flg & (PROJECT_DISI))
                        {
-                               if ((n > 0) && cave_stop_disintegration(y, x)) break;
+                               if ((n > 0) && cave_stop_disintegration(floor_ptr, y, x)) break;
                        }
                        else if (flg & (PROJECT_LOS))
                        {
@@ -1462,7 +1462,7 @@ sint project_path(floor_type *floor_ptr, u16b *gp, POSITION range, POSITION y1,
 
                        if (flg & (PROJECT_DISI))
                        {
-                               if ((n > 0) && cave_stop_disintegration(y, x)) break;
+                               if ((n > 0) && cave_stop_disintegration(floor_ptr, y, x)) break;
                        }
                        else if (flg & (PROJECT_LOS))
                        {
@@ -1533,7 +1533,7 @@ sint project_path(floor_type *floor_ptr, u16b *gp, POSITION range, POSITION y1,
 
                        if (flg & (PROJECT_DISI))
                        {
-                               if ((n > 0) && cave_stop_disintegration(y, x)) break;
+                               if ((n > 0) && cave_stop_disintegration(floor_ptr, y, x)) break;
                        }
                        else if (flg & (PROJECT_LOS))
                        {
index 15ba01e..c594dcb 100644 (file)
@@ -324,10 +324,10 @@ extern floor_type floor_info;
 /*
  * Does the grid stop disintegration?
  */
-#define cave_stop_disintegration(Y,X) \
-       (!cave_have_flag_bold(p_ptr->current_floor_ptr, (Y), (X), FF_PROJECT) && \
-        (!cave_have_flag_bold(p_ptr->current_floor_ptr, (Y), (X), FF_HURT_DISI) || \
-         cave_have_flag_bold(p_ptr->current_floor_ptr, (Y), (X), FF_PERMANENT)))
+#define cave_stop_disintegration(F,Y,X) \
+       (!cave_have_flag_bold((F), (Y), (X), FF_PROJECT) && \
+        (!cave_have_flag_bold((F), (Y), (X), FF_HURT_DISI) || \
+         cave_have_flag_bold((F), (Y), (X), FF_PERMANENT)))
 
 
 /*
index 5eeced4..357e545 100644 (file)
@@ -139,7 +139,7 @@ static bool breath_direct(player_type *master_ptr, POSITION y1, POSITION x1, POS
                if (flg & PROJECT_DISI)
                {
                        /* Hack -- Balls explode before reaching walls */
-                       if (cave_stop_disintegration(ny, nx)) break;
+                       if (cave_stop_disintegration(master_ptr->current_floor_ptr, ny, nx)) break;
                }
                else if (flg & PROJECT_LOS)
                {
index 264a308..69a3c50 100644 (file)
@@ -5151,7 +5151,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
                {
                        for (ty = y1 + 1; ty < y2; ty++)
                        {
-                               if (cave_stop_disintegration(ty, x1)) return (FALSE);
+                               if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, x1)) return (FALSE);
                        }
                }
 
@@ -5160,7 +5160,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
                {
                        for (ty = y1 - 1; ty > y2; ty--)
                        {
-                               if (cave_stop_disintegration(ty, x1)) return (FALSE);
+                               if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, x1)) return (FALSE);
                        }
                }
 
@@ -5176,7 +5176,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
                {
                        for (tx = x1 + 1; tx < x2; tx++)
                        {
-                               if (cave_stop_disintegration(y1, tx)) return (FALSE);
+                               if (cave_stop_disintegration(p_ptr->current_floor_ptr, y1, tx)) return (FALSE);
                        }
                }
 
@@ -5185,7 +5185,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
                {
                        for (tx = x1 - 1; tx > x2; tx--)
                        {
-                               if (cave_stop_disintegration(y1, tx)) return (FALSE);
+                               if (cave_stop_disintegration(p_ptr->current_floor_ptr, y1, tx)) return (FALSE);
                        }
                }
 
@@ -5202,7 +5202,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
        {
                if (ay == 2)
                {
-                       if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
+                       if (!cave_stop_disintegration(p_ptr->current_floor_ptr, y1 + sy, x1)) return (TRUE);
                }
        }
 
@@ -5211,7 +5211,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
        {
                if (ax == 2)
                {
-                       if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
+                       if (!cave_stop_disintegration(p_ptr->current_floor_ptr, y1, x1 + sx)) return (TRUE);
                }
        }
 
@@ -5246,7 +5246,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
                /* the LOS exactly meets the corner of a tile. */
                while (x2 - tx)
                {
-                       if (cave_stop_disintegration(ty, tx)) return (FALSE);
+                       if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, tx)) return (FALSE);
 
                        qy += m;
 
@@ -5257,7 +5257,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
                        else if (qy > f2)
                        {
                                ty += sy;
-                               if (cave_stop_disintegration(ty, tx)) return (FALSE);
+                               if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, tx)) return (FALSE);
                                qy -= f1;
                                tx += sx;
                        }
@@ -5293,7 +5293,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
                /* the LOS exactly meets the corner of a tile. */
                while (y2 - ty)
                {
-                       if (cave_stop_disintegration(ty, tx)) return (FALSE);
+                       if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, tx)) return (FALSE);
 
                        qx += m;
 
@@ -5304,7 +5304,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
                        else if (qx > f2)
                        {
                                tx += sx;
-                               if (cave_stop_disintegration(ty, tx)) return (FALSE);
+                               if (cave_stop_disintegration(p_ptr->current_floor_ptr, ty, tx)) return (FALSE);
                                qx -= f1;
                                ty += sy;
                        }
@@ -5992,7 +5992,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                if (flg & PROJECT_DISI)
                {
                        /* Hack -- Balls explode before reaching walls */
-                       if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
+                       if (cave_stop_disintegration(caster_ptr->current_floor_ptr, ny, nx) && (rad > 0)) break;
                }
                else if (flg & PROJECT_LOS)
                {
index 01e4308..bba37f5 100644 (file)
@@ -3415,7 +3415,7 @@ bool cast_wrath_of_the_god(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
 
                /* Cannot penetrate perm walls */
                if (!in_bounds(caster_ptr->current_floor_ptr, y, x) ||
-                       cave_stop_disintegration(y, x) ||
+                       cave_stop_disintegration(caster_ptr->current_floor_ptr, y, x) ||
                        !in_disintegration_range(ty, tx, y, x))
                        continue;