OSDN Git Service

[Refactor] #38997 in_bound() に floor_type * 引数を追加. / Add floor_type * argument to...
authordeskull <deskull@users.sourceforge.jp>
Thu, 19 Sep 2019 12:03:39 +0000 (21:03 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 19 Sep 2019 12:03:39 +0000 (21:03 +0900)
24 files changed:
src/floor-generate.c
src/floor-save.c
src/floor-streams.c
src/floor.c
src/floor.h
src/geometry.c
src/grid.c
src/mind.c
src/monster-process.c
src/monster1.c
src/monster2.c
src/mspells1.c
src/object2.c
src/player-inventory.c
src/player-move.c
src/rooms-vault.c
src/rooms.c
src/spells-floor.c
src/spells1.c
src/spells2.c
src/spells3.c
src/targeting.c
src/trap.c
src/warning.c

index b57deb3..a346f55 100644 (file)
@@ -143,17 +143,17 @@ dun_data *dun;
  * @param y 基準のy座標
  * @param x 基準のx座標
  * @return 隣接する外壁の数
- * @note Assumes "in_bounds(y, x)"
+ * @note Assumes "in_bounds(current_floor_ptr, y, x)"
  * @details We count only granite walls and permanent walls.
  */
 static int next_to_walls(POSITION y, POSITION x)
 {
        int k = 0;
 
-       if (in_bounds(y + 1, x) && is_extra_bold(y + 1, x)) k++;
-       if (in_bounds(y - 1, x) && is_extra_bold(y - 1, x)) k++;
-       if (in_bounds(y, x + 1) && is_extra_bold(y, x + 1)) k++;
-       if (in_bounds(y, x - 1) && is_extra_bold(y, x - 1)) k++;
+       if (in_bounds(current_floor_ptr, y + 1, x) && is_extra_bold(y + 1, x)) k++;
+       if (in_bounds(current_floor_ptr, y - 1, x) && is_extra_bold(y - 1, x)) k++;
+       if (in_bounds(current_floor_ptr, y, x + 1) && is_extra_bold(y, x + 1)) k++;
+       if (in_bounds(current_floor_ptr, y, x - 1) && is_extra_bold(y, x - 1)) k++;
 
        return (k);
 }
@@ -1592,7 +1592,7 @@ bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2)
 
 
                /* Extremely Important -- do not leave the dungeon */
-               while (!in_bounds(tmp_row, tmp_col))
+               while (!in_bounds(current_floor_ptr, tmp_row, tmp_col))
                {
                        /* Acquire the correct direction */
                        correct_dir(&row_dir, &col_dir, row1, col1, row2, col2);
@@ -1748,7 +1748,7 @@ static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall)
 
        grid_type *g_ptr = &current_floor_ptr->grid_array[*y][*x];
 
-       if (!in_bounds(*y, *x)) return TRUE;
+       if (!in_bounds(current_floor_ptr, *y, *x)) return TRUE;
 
        if (is_inner_grid(g_ptr))
        {
@@ -1823,7 +1823,7 @@ static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall)
                        dy = randint0(3) - 1;
                        dx = randint0(3) - 1;
 
-                       if (!in_bounds(*y + dy, *x + dx))
+                       if (!in_bounds(current_floor_ptr, *y + dy, *x + dx))
                        {
                                dx = 0;
                                dy = 0;
@@ -2061,7 +2061,7 @@ bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type,
                y3 = y1 + dy + changey;
 
                /* See if in bounds - if not - do not perturb point */
-               if (!in_bounds(y3, x3))
+               if (!in_bounds(current_floor_ptr, y3, x3))
                {
                        x3 = (x1 + x2) / 2;
                        y3 = (y1 + y2) / 2;
@@ -2080,7 +2080,7 @@ bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type,
                        {
                                dy = randint0(3) - 1;
                                dx = randint0(3) - 1;
-                               if (!in_bounds(y3 + dy, x3 + dx))
+                               if (!in_bounds(current_floor_ptr, y3 + dy, x3 + dx))
                                {
                                        dx = 0;
                                        dy = 0;
index 0215f8c..4de6f0c 100644 (file)
@@ -722,7 +722,7 @@ static void get_out_monster(void)
                if (tries > 20 * dis * dis) dis++;
 
                /* Ignore illegal locations */
-               if (!in_bounds(ny, nx)) continue;
+               if (!in_bounds(current_floor_ptr, ny, nx)) continue;
 
                /* Require "empty" floor space */
                if (!cave_empty_bold(ny, nx)) continue;
index 8393340..99d2519 100644 (file)
@@ -83,7 +83,7 @@ static void recursive_river(POSITION x1, POSITION y1, POSITION x2, POSITION y2,
                        changey = 0;
                }
 
-               if (!in_bounds(y1 + dy + changey, x1 + dx + changex))
+               if (!in_bounds(current_floor_ptr, y1 + dy + changey, x1 + dx + changex))
                {
                        changex = 0;
                        changey = 0;
@@ -372,7 +372,7 @@ void build_streamer(FEAT_IDX feat, int chance)
                }
 
                /* Quit before leaving the dungeon */
-               if (!in_bounds(y, x)) break;
+               if (!in_bounds(current_floor_ptr, y, x)) break;
        }
 }
 
@@ -399,7 +399,7 @@ void place_trees(POSITION x, POSITION y)
        {
                for (j = y - 3; j < y + 4; j++)
                {
-                       if (!in_bounds(j, i)) continue;
+                       if (!in_bounds(current_floor_ptr, j, i)) continue;
                        g_ptr = &current_floor_ptr->grid_array[j][i];
 
                        if (g_ptr->info & CAVE_ICKY) continue;
index ab57e84..376e9a7 100644 (file)
@@ -3,7 +3,7 @@
 #include "floor-save.h"
 
 /*
- * The array of "current_floor_ptr->grid_array grids" [MAX_WID][MAX_HGT].
+ * The array of floor [MAX_WID][MAX_HGT].
  * Not completely allocated, that would be inefficient
  * Not completely hardcoded, that would overflow memory
  */
index f4b06f1..2b684ba 100644 (file)
 #define MAX_WID 198
 
 /*!
- * @brief プレイヤー用光源処理配列サイズ / Maximum size of the "lite" array (see "current_floor_ptr->grid_array.c")
+ * @brief プレイヤー用光源処理配列サイズ / Maximum size of the "lite" array (see "grid.c")
  * @details Note that the "lite radius" will NEVER exceed 14, and we would
  * never require more than 581 entries in the array for circular "lite".
  */
 #define LITE_MAX 600
 
 /*!
- * @brief モンスター用光源処理配列サイズ / Maximum size of the "mon_lite" array (see "current_floor_ptr->grid_array.c")
+ * @brief モンスター用光源処理配列サイズ / Maximum size of the "mon_lite" array (see ">grid.c")
  * @details Note that the "view radius" will NEVER exceed 20, monster illumination
  * flags are dependent on CAVE_VIEW, and even if the "view" was octagonal,
  * we would never require more than 1520 entries in the array.
@@ -171,8 +171,8 @@ typedef struct {
 /*
  * Determines if a map location is fully inside the outer walls
  */
-#define in_bounds(Y,X) \
-   (((Y) > 0) && ((X) > 0) && ((Y) < current_floor_ptr->height-1) && ((X) < current_floor_ptr->width-1))
+#define in_bounds(F,Y,X) \
+   (((Y) > 0) && ((X) > 0) && ((Y) < (F)->height-1) && ((X) < (F)->width-1))
 
 /*
  * Determines if a map location is on or inside the outer walls
index cb6e5b1..88ff92c 100644 (file)
@@ -280,7 +280,7 @@ sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y
                                        break;
                        }
 
-                       if (!in_bounds(y, x)) break;
+                       if (!in_bounds(current_floor_ptr, y, x)) break;
 
                        /* Slant */
                        if (m)
@@ -369,7 +369,7 @@ sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y
                                        break;
                        }
 
-                       if (!in_bounds(y, x)) break;
+                       if (!in_bounds(current_floor_ptr, y, x)) break;
 
                        /* Slant */
                        if (m)
@@ -440,7 +440,7 @@ sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y
                                        break;
                        }
 
-                       if (!in_bounds(y, x)) break;
+                       if (!in_bounds(current_floor_ptr, y, x)) break;
 
                        /* Advance (Y) */
                        y += sy;
@@ -534,8 +534,8 @@ bool los(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
 
 
        /* Paranoia -- require "safe" origin */
-       /* if (!in_bounds(y1, x1)) return FALSE; */
-       /* if (!in_bounds(y2, x2)) return FALSE; */
+       /* if (!in_bounds(current_floor_ptr, y1, x1)) return FALSE; */
+       /* if (!in_bounds(current_floor_ptr, y2, x2)) return FALSE; */
 
 
        /* Directly South/North */
@@ -774,7 +774,7 @@ void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT
                nx = rand_spread(x, d);
 
                /* Ignore annoying locations */
-               if (!in_bounds(ny, nx)) continue;
+               if (!in_bounds(current_floor_ptr, ny, nx)) continue;
 
                /* Ignore "excessively distant" locations */
                if ((d > 1) && (distance(y, x, ny, nx) > d)) continue;
index bacbec8..791f8fb 100644 (file)
@@ -222,7 +222,7 @@ bool new_player_spot(void)
                        if (!have_flag(f_ptr->flags, FF_TELEPORTABLE)) continue;
                }
                if (!player_can_enter(g_ptr->feat, 0)) continue;
-               if (!in_bounds(y, x)) continue;
+               if (!in_bounds(current_floor_ptr, y, x)) continue;
 
                /* Refuse to start on anti-teleport grids */
                if (g_ptr->info & (CAVE_ICKY)) continue;
@@ -539,7 +539,7 @@ void add_door(POSITION x, POSITION y)
 * @param y1 基準となるマスのY座標
 * @param x1 基準となるマスのX座標
 * @return 通路の数
-* @note Assumes "in_bounds(y1, x1)"
+* @note Assumes "in_bounds(current_floor_ptr, y1, x1)"
 * @details
 * XXX XXX This routine currently only counts actual "empty floor"\n
 * grids which are not in rooms.  We might want to also count stairs,\n
@@ -582,10 +582,10 @@ static int next_to_corr(POSITION y1, POSITION x1)
 * @param y 判定を行いたいマスのY座標
 * @param x 判定を行いたいマスのX座標
 * @return ドアを設置可能ならばTRUEを返す
-* @note Assumes "in_bounds(y1, x1)"
+* @note Assumes "in_bounds(current_floor_ptr, y1, x1)"
 * @details
 * \n
-* Assumes "in_bounds(y, x)"\n
+* Assumes "in_bounds(current_floor_ptr, y, x)"\n
 */
 static bool possible_doorway(POSITION y, POSITION x)
 {
@@ -618,7 +618,7 @@ static bool possible_doorway(POSITION y, POSITION x)
 * @return なし
 */
 void try_door(POSITION y, POSITION x)
-{      if (!in_bounds(y, x)) return;
+{      if (!in_bounds(current_floor_ptr, y, x)) return;
 
        /* Ignore walls */
        if (cave_have_flag_bold(y, x, FF_WALL)) return;
@@ -719,7 +719,7 @@ void vault_objects(POSITION y, POSITION x, int num)
                                j = rand_spread(y, 2);
                                k = rand_spread(x, 3);
                                dummy++;
-                               if (!in_bounds(j, k)) continue;
+                               if (!in_bounds(current_floor_ptr, j, k)) continue;
                                break;
                        }
 
@@ -773,7 +773,7 @@ void vault_trap_aux(POSITION y, POSITION x, POSITION yd, POSITION xd)
                        y1 = rand_spread(y, yd);
                        x1 = rand_spread(x, xd);
                        dummy++;
-                       if (!in_bounds(y1, x1)) continue;
+                       if (!in_bounds(current_floor_ptr, y1, x1)) continue;
                        break;
                }
 
@@ -860,7 +860,7 @@ void vault_monsters(POSITION y1, POSITION x1, int num)
  */
 bool get_is_floor(POSITION x, POSITION y)
 {
-       if (!in_bounds(y, x))
+       if (!in_bounds(current_floor_ptr, y, x))
        {
                /* Out of bounds */
                return (FALSE);
@@ -880,7 +880,7 @@ bool get_is_floor(POSITION x, POSITION y)
  */
 void set_floor(POSITION x, POSITION y)
 {
-       if (!in_bounds(y, x))
+       if (!in_bounds(current_floor_ptr, y, x))
        {
                /* Out of bounds */
                return;
@@ -1021,7 +1021,7 @@ void update_local_illumination(player_type * creature_ptr, POSITION y, POSITION
        int i;
        POSITION yy, xx;
 
-       if (!in_bounds(y, x)) return;
+       if (!in_bounds(current_floor_ptr, y, x)) return;
 
 #ifdef COMPLEX_WALL_ILLUMINATION /* COMPLEX_WALL_ILLUMINATION */
 
@@ -1698,7 +1698,7 @@ void update_flow(void)
        if (tmp_pos.n) return;
 
        /* The last way-point is on the map */
-       if (p_ptr->running && in_bounds(flow_y, flow_x))
+       if (p_ptr->running && in_bounds(current_floor_ptr, flow_y, flow_x))
        {
                /* The way point is in sight - do not update.  (Speedup) */
                if (current_floor_ptr->grid_array[flow_y][flow_x].info & CAVE_VIEW) return;
@@ -1843,7 +1843,7 @@ void update_smell(void)
                        x = j + p_ptr->x - 2;
 
                        /* Check Bounds */
-                       if (!in_bounds(y, x)) continue;
+                       if (!in_bounds(current_floor_ptr, y, x)) continue;
 
                        g_ptr = &current_floor_ptr->grid_array[y][x];
 
index f3c71be..b81bdcf 100644 (file)
@@ -1659,7 +1659,7 @@ static bool cast_ninja_spell(int spell)
                        POSITION nx = GRID_X(path_g[i]);
                        grid_type *g_ptr = &current_floor_ptr->grid_array[ny][nx];
 
-                       if (in_bounds(ny, nx) && cave_empty_bold(ny, nx) &&
+                       if (in_bounds(current_floor_ptr, ny, nx) && cave_empty_bold(ny, nx) &&
                            !(g_ptr->info & CAVE_OBJECT) &&
                                !pattern_tile(ny, nx))
                        {
index f04bbec..f62e26d 100644 (file)
@@ -739,7 +739,7 @@ static bool find_safety(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
                        x = fx + dx;
 
                        /* Skip illegal locations */
-                       if (!in_bounds(y, x)) continue;
+                       if (!in_bounds(current_floor_ptr, y, x)) continue;
 
                        g_ptr = &current_floor_ptr->grid_array[y][x];
 
@@ -831,7 +831,7 @@ static bool find_hiding(MONSTER_IDX m_idx, POSITION *yp, POSITION *xp)
                        x = fx + dx;
 
                        /* Skip illegal locations */
-                       if (!in_bounds(y, x)) continue;
+                       if (!in_bounds(current_floor_ptr, y, x)) continue;
 
                        /* Skip occupied locations */
                        if (!monster_can_enter(y, x, r_ptr, 0)) continue;
index fd4b5b7..90996b6 100644 (file)
@@ -2750,7 +2750,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item)
                                do
                                {
                                        scatter(&wy, &wx, y, x, 20, 0);
-                               } while (!(in_bounds(wy, wx) && cave_empty_bold2(wy, wx)) && --attempts);
+                               } while (!(in_bounds(current_floor_ptr, wy, wx) && cave_empty_bold2(wy, wx)) && --attempts);
 
                                if (attempts > 0)
                                {
index 8b0b3ef..f1ef5c8 100644 (file)
@@ -184,7 +184,7 @@ void delete_monster_idx(MONSTER_IDX i)
 void delete_monster(POSITION y, POSITION x)
 {
        grid_type *g_ptr;
-       if (!in_bounds(y, x)) return;
+       if (!in_bounds(current_floor_ptr, y, x)) return;
 
        /* Check the grid */
        g_ptr = &current_floor_ptr->grid_array[y][x];
@@ -2522,7 +2522,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
        /* DO NOT PLACE A MONSTER IN THE SMALL SCALE WILDERNESS !!! */
        if (p_ptr->wild_mode) return FALSE;
 
-       if (!in_bounds(y, x)) return (FALSE);
+       if (!in_bounds(current_floor_ptr, y, x)) return (FALSE);
        if (!r_idx) return (FALSE);
        if (!r_ptr->name) return (FALSE);
 
@@ -2910,7 +2910,7 @@ static bool mon_scatter(MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION
                for (ny = y - max_dist; ny <= y + max_dist; ny++)
                {
                        /* Ignore annoying locations */
-                       if (!in_bounds(ny, nx)) continue;
+                       if (!in_bounds(current_floor_ptr, ny, nx)) continue;
 
                        /* Require "line of projection" */
                        if (!projectable(y, x, ny, nx)) continue;
@@ -4080,7 +4080,7 @@ int get_monster_crowd_number(MONSTER_IDX m_idx)
                int ay = my + ddy_ddd[i];
                int ax = mx + ddx_ddd[i];
 
-               if (!in_bounds(ay, ax)) continue;
+               if (!in_bounds(current_floor_ptr, ay, ax)) continue;
 
                /* Count number of monsters */
                if (current_floor_ptr->grid_array[ay][ax].m_idx > 0) count++;
index f71c209..7eb3a89 100644 (file)
@@ -389,7 +389,7 @@ bool summon_possible(POSITION y1, POSITION x1)
                for (x = x1 - 2; x <= x1 + 2; x++)
                {
                        /* Ignore illegal locations */
-                       if (!in_bounds(y, x)) continue;
+                       if (!in_bounds(current_floor_ptr, y, x)) continue;
 
                        /* Only check a circular area */
                        if (distance(y1, x1, y, x)>2) continue;
index 4542b79..df04bbc 100644 (file)
@@ -198,7 +198,7 @@ void delete_object(POSITION y, POSITION x)
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
        /* Refuse "illegal" locations */
-       if (!in_bounds(y, x)) return;
+       if (!in_bounds(current_floor_ptr, y, x)) return;
 
        g_ptr = &current_floor_ptr->grid_array[y][x];
 
@@ -4399,7 +4399,7 @@ void place_object(POSITION y, POSITION x, BIT_FLAGS mode)
 
 
        /* Paranoia -- check bounds */
-       if (!in_bounds(y, x)) return;
+       if (!in_bounds(current_floor_ptr, y, x)) return;
 
        /* Require floor space */
        if (!cave_drop_bold(y, x)) return;
@@ -4510,7 +4510,7 @@ void place_gold(POSITION y, POSITION x)
 
 
        /* Paranoia -- check bounds */
-       if (!in_bounds(y, x)) return;
+       if (!in_bounds(current_floor_ptr, y, x)) return;
 
        /* Require floor space */
        if (!cave_drop_bold(y, x)) return;
@@ -4556,7 +4556,7 @@ void place_gold(POSITION y, POSITION x)
  * @param x 配置したいフロアのX座標
  * @return 生成に成功したらオブジェクトのIDを返す。
  * @details
- * The initial location is assumed to be "in_bounds()".\n
+ * The initial location is assumed to be "in_bounds(current_floor_ptr, )".\n
  *\n
  * This function takes a parameter "chance".  This is the percentage\n
  * chance that the item will "disappear" instead of drop.  If the object\n
@@ -4639,7 +4639,7 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION
                        ty = y + dy;
                        tx = x + dx;
 
-                       if (!in_bounds(ty, tx)) continue;
+                       if (!in_bounds(current_floor_ptr, ty, tx)) continue;
 
                        /* Require line of projection */
                        if (!projectable(y, x, ty, tx)) continue;
@@ -4718,7 +4718,7 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION
                ty = rand_spread(by, 1);
                tx = rand_spread(bx, 1);
 
-               if (!in_bounds(ty, tx)) continue;
+               if (!in_bounds(current_floor_ptr, ty, tx)) continue;
 
                /* Bounce to that location */
                by = ty;
index 7ecd3b6..37505be 100644 (file)
@@ -1656,7 +1656,7 @@ ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode
        ITEM_NUMBER num = 0;
 
        /* Sanity */
-       if (!in_bounds(y, x)) return 0;
+       if (!in_bounds(current_floor_ptr, y, x)) return 0;
 
        /* Scan all objects in the grid */
        for (this_o_idx = current_floor_ptr->grid_array[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
index 77fe5ee..ee62d13 100644 (file)
@@ -2121,7 +2121,7 @@ static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall)
        int cost;
 
        /* Ignore out of bounds */
-       if (!in_bounds(y, x)) return;
+       if (!in_bounds(current_floor_ptr, y, x)) return;
 
        /* Ignore unknown grid except in wilderness */
        if (current_floor_ptr->dun_level > 0 && !(g_ptr->info & CAVE_KNOWN)) return;
index a66a772..c2d56f7 100644 (file)
@@ -1045,7 +1045,7 @@ static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
        /* generate the room */
        for (x = x1 - 2; x <= x2 + 2; x++)
        {
-               if (!in_bounds(y1 - 2, x)) break;
+               if (!in_bounds(current_floor_ptr, y1 - 2, x)) break;
 
                current_floor_ptr->grid_array[y1 - 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
 
@@ -1054,7 +1054,7 @@ static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
 
        for (x = x1 - 2; x <= x2 + 2; x++)
        {
-               if (!in_bounds(y2 + 2, x)) break;
+               if (!in_bounds(current_floor_ptr, y2 + 2, x)) break;
 
                current_floor_ptr->grid_array[y2 + 2][x].info |= (CAVE_ROOM | CAVE_ICKY);
 
@@ -1063,7 +1063,7 @@ static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
 
        for (y = y1 - 2; y <= y2 + 2; y++)
        {
-               if (!in_bounds(y, x1 - 2)) break;
+               if (!in_bounds(current_floor_ptr, y, x1 - 2)) break;
 
                current_floor_ptr->grid_array[y][x1 - 2].info |= (CAVE_ROOM | CAVE_ICKY);
 
@@ -1072,7 +1072,7 @@ static void build_mini_c_vault(POSITION x0, POSITION y0, POSITION xsize, POSITIO
 
        for (y = y1 - 2; y <= y2 + 2; y++)
        {
-               if (!in_bounds(y, x2 + 2)) break;
+               if (!in_bounds(current_floor_ptr, y, x2 + 2)) break;
 
                current_floor_ptr->grid_array[y][x2 + 2].info |= (CAVE_ROOM | CAVE_ICKY);
 
index 8d62ca9..dd1d40a 100644 (file)
@@ -905,7 +905,7 @@ static void cave_fill(POSITION y, POSITION x)
                        i = tx + ddx_ddd[d];
 
                        /* Paranoia Don't leave the current_floor_ptr->grid_array */
-                       if (!in_bounds(j, i))
+                       if (!in_bounds(current_floor_ptr, j, i))
                        {
                                /* affect boundary */
                                current_floor_ptr->grid_array[j][i].info |= CAVE_ICKY;
@@ -1969,7 +1969,7 @@ void add_outer_wall(POSITION x, POSITION y, int light, POSITION x1, POSITION y1,
        feature_type *f_ptr;
        int i, j;
 
-       if (!in_bounds(y, x)) return;
+       if (!in_bounds(current_floor_ptr, y, x)) return;
 
        g_ptr = &current_floor_ptr->grid_array[y][x];
 
index 3d1e945..967a9e1 100644 (file)
@@ -484,7 +484,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
        {
                for (x = (x1 - r); x <= (x1 + r); x++)
                {
-                       if (!in_bounds(y, x)) continue;
+                       if (!in_bounds(current_floor_ptr, y, x)) continue;
 
                        /* Extract the distance */
                        k = distance(y1, x1, y, x);
@@ -652,7 +652,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                {
                        for (x = (x1 - r); x <= (x1 + r); x++)
                        {
-                               if (!in_bounds(y, x)) continue;
+                               if (!in_bounds(current_floor_ptr, y, x)) continue;
 
                                /* Extract the distance */
                                k = distance(y1, x1, y, x);
@@ -780,7 +780,7 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        yy = cy + dy;
                        xx = cx + dx;
 
-                       if (!in_bounds(yy, xx)) continue;
+                       if (!in_bounds(current_floor_ptr, yy, xx)) continue;
 
                        /* Skip distant grids */
                        if (distance(cy, cx, yy, xx) > r) continue;
@@ -1115,7 +1115,7 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        yy = cy + dy;
                        xx = cx + dx;
 
-                       if (!in_bounds(yy, xx)) continue;
+                       if (!in_bounds(current_floor_ptr, yy, xx)) continue;
 
                        /* Skip distant grids */
                        if (distance(cy, cx, yy, xx) > r) continue;
index 8401f3a..9b29aa5 100644 (file)
@@ -5139,7 +5139,7 @@ bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
        if ((ax < 2) && (ay < 2)) return (TRUE);
 
        /* Paranoia -- require "safe" origin */
-       /* if (!in_bounds(y1, x1)) return (FALSE); */
+       /* if (!in_bounds(current_floor_ptr, y1, x1)) return (FALSE); */
 
        /* Directly South/North */
        if (!dx)
@@ -5362,7 +5362,7 @@ void breath_shape(u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *g
                                for (x = bx - cdis; x <= bx + cdis; x++)
                                {
                                        /* Ignore "illegal" locations */
-                                       if (!in_bounds(y, x)) continue;
+                                       if (!in_bounds(current_floor_ptr, y, x)) continue;
 
                                        /* Enforce a circular "ripple" */
                                        if (distance(y1, x1, y, x) != bdis) continue;
index f4379dd..e099825 100644 (file)
@@ -1678,7 +1678,7 @@ static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pa
                 * properly.
                 * This leaves only a check for 6 bounding walls!
                 */
-               if (in_bounds(y, x) && pass_bold(y, x) &&
+               if (in_bounds(current_floor_ptr, y, x) && pass_bold(y, x) &&
                    (next_to_walls_adj(y, x, pass_bold) == 6) && (next_to_open(y, x, pass_bold) <= 1)) return;
        }
 
@@ -3019,7 +3019,7 @@ bool rush_attack(bool *mdeath)
                ty = target_row;
        }
 
-       if (in_bounds(ty, tx)) tm_idx = current_floor_ptr->grid_array[ty][tx].m_idx;
+       if (in_bounds(current_floor_ptr, ty, tx)) tm_idx = current_floor_ptr->grid_array[ty][tx].m_idx;
 
        path_n = project_path(path_g, project_length, p_ptr->y, p_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL);
        project_length = 0;
@@ -3322,7 +3322,7 @@ void cast_meteor(HIT_POINT dam, POSITION rad)
 
                        if (d >= 9) continue;
 
-                       if (!in_bounds(y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)
+                       if (!in_bounds(current_floor_ptr, y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)
                                || !cave_have_flag_bold(y, x, FF_PROJECT)) continue;
 
                        /* Valid position */
@@ -3414,7 +3414,7 @@ bool cast_wrath_of_the_god(HIT_POINT dam, POSITION rad)
                if (count < 0) continue;
 
                /* Cannot penetrate perm walls */
-               if (!in_bounds(y, x) ||
+               if (!in_bounds(current_floor_ptr, y, x) ||
                        cave_stop_disintegration(y, x) ||
                        !in_disintegration_range(ty, tx, y, x))
                        continue;
index 7b8c25b..ff1df6b 100644 (file)
@@ -119,7 +119,7 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
                        }
 
                        /* Ignore illegal locations */
-                       if (!in_bounds(ny, nx)) continue;
+                       if (!in_bounds(current_floor_ptr, ny, nx)) continue;
 
                        if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
 
@@ -220,7 +220,7 @@ void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power,
                        }
 
                        /* Ignore illegal locations */
-                       if (!in_bounds(ny, nx)) continue;
+                       if (!in_bounds(current_floor_ptr, ny, nx)) continue;
 
                        if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue;
 
@@ -510,7 +510,7 @@ void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode)
                {
                        y = (POSITION)rand_spread(ny, dis);
                        x = (POSITION)rand_spread(nx, dis);
-                       if (in_bounds(y, x)) break;
+                       if (in_bounds(current_floor_ptr, y, x)) break;
                }
 
                /* Accept any grid when wizard mode */
index e6bc8d3..1e1421d 100644 (file)
@@ -324,7 +324,7 @@ static bool target_set_accept(POSITION y, POSITION x)
        grid_type *g_ptr;
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
-       if (!(in_bounds(y, x))) return (FALSE);
+       if (!(in_bounds(current_floor_ptr, y, x))) return (FALSE);
 
        /* Player grid is always interesting */
        if (player_bold(y, x)) return (TRUE);
@@ -1936,7 +1936,7 @@ static bool tgt_pt_accept(POSITION y, POSITION x)
 {
        grid_type *g_ptr;
 
-       if (!(in_bounds(y, x))) return (FALSE);
+       if (!(in_bounds(current_floor_ptr, y, x))) return (FALSE);
 
        /* Player grid is always interesting */
        if ((y == p_ptr->y) && (x == p_ptr->x)) return (TRUE);
index 5e413c6..503d60a 100644 (file)
@@ -210,7 +210,7 @@ void place_trap(POSITION y, POSITION x)
        grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
 
        /* Paranoia -- verify location */
-       if (!in_bounds(y, x)) return;
+       if (!in_bounds(current_floor_ptr, y, x)) return;
 
        /* Require empty, clean, floor grid */
        if (!cave_clean_bold(y, x)) return;
@@ -620,7 +620,7 @@ void hit_trap(player_type *trapped_ptr, bool break_trap)
                                POSITION x1 = rand_spread(x, 7);
                                POSITION y1 = rand_spread(y, 5);
 
-                               if (!in_bounds(y1, x1)) continue;
+                               if (!in_bounds(current_floor_ptr, y1, x1)) continue;
 
                                /* Require line of projection */
                                if (!projectable(trapped_ptr->y, trapped_ptr->x, y1, x1)) continue;
index 6c0ad67..4e52fea 100644 (file)
@@ -415,7 +415,7 @@ bool process_warning(POSITION xx, POSITION yy)
                        monster_type *m_ptr;
                        monster_race *r_ptr;
 
-                       if (!in_bounds(my, mx) || (distance(my, mx, yy, xx) > WARNING_AWARE_RANGE)) continue;
+                       if (!in_bounds(current_floor_ptr, my, mx) || (distance(my, mx, yy, xx) > WARNING_AWARE_RANGE)) continue;
 
                        g_ptr = &current_floor_ptr->grid_array[my][mx];