OSDN Git Service

[Refactor] #38997 *_door() のfloor_type * 引数をplayer_type * 引数に変更 / Changed argument...
authorHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 01:39:07 +0000 (10:39 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 01:39:07 +0000 (10:39 +0900)
19 files changed:
src/core.c
src/floor-generate.c
src/floor.c
src/floor.h
src/grid.c
src/player-status.c
src/quest.c
src/rooms-city.c
src/rooms-city.h
src/rooms-normal.c
src/rooms-pitnest.c
src/rooms-pitnest.h
src/rooms-special.c
src/rooms-vault.c
src/rooms.c
src/rooms.h
src/spells-floor.c
src/spells1.c
src/wizard2.c

index 6e20b1a..3a5a7f2 100644 (file)
@@ -711,7 +711,7 @@ static bool pattern_effect(player_type *creature_ptr)
                (void)restore_level(creature_ptr);
                (void)cure_critical_wounds(creature_ptr, 1000);
 
-               cave_set_feat(floor_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_old);
+               cave_set_feat(creature_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_old);
                msg_print(_("「パターン」のこの部分は他の部分より強力でないようだ。", "This section of the Pattern looks less powerful."));
 
                /*
index a0ab093..02f8d79 100644 (file)
@@ -855,7 +855,7 @@ static bool cave_gen(player_type *player_ptr)
                                if ((randint0(100) < dun_tun_pen) && !(dungeon_ptr->flags1 & DF1_NO_DOORS))
                                {
                                        /* Place a random door */
-                                       place_random_door(floor_ptr, y, x, TRUE);
+                                       place_random_door(player_ptr, y, x, TRUE);
                                }
                        }
 
@@ -872,10 +872,10 @@ static bool cave_gen(player_type *player_ptr)
                        x = dun->door[i].x;
 
                        /* Try placing doors */
-                       try_door(floor_ptr, y, x - 1);
-                       try_door(floor_ptr, y, x + 1);
-                       try_door(floor_ptr, y - 1, x);
-                       try_door(floor_ptr, y + 1, x);
+                       try_door(player_ptr, y, x - 1);
+                       try_door(player_ptr, y, x + 1);
+                       try_door(player_ptr, y - 1, x);
+                       try_door(player_ptr, y + 1, x);
                }
 
                /* Place 3 or 4 down stairs near some walls */
index faaf39b..e09a123 100644 (file)
@@ -52,13 +52,15 @@ void place_locked_door(player_type *player_ptr, POSITION y, POSITION x)
 
 /*!
 * @brief 隠しドアを配置する
+* @param player_ptr プレーヤーへの参照ポインタ
 * @param y 配置したいフロアのY座標
 * @param x 配置したいフロアのX座標
 * @param type DOOR_DEFAULT / DOOR_DOOR / DOOR_GLASS_DOOR / DOOR_CURTAIN のいずれか
 * @return なし
 */
-void place_secret_door(floor_type *floor_ptr, POSITION y, POSITION x, int type)
+void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type)
 {
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        if (d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_DOORS)
        {
                place_floor_bold(floor_ptr, y, x);
@@ -75,7 +77,7 @@ void place_secret_door(floor_type *floor_ptr, POSITION y, POSITION x, int type)
                }
 
                /* Create secret door */
-               place_closed_door(floor_ptr, y, x, type);
+               place_closed_door(player_ptr, y, x, type);
 
                if (type != DOOR_CURTAIN)
                {
@@ -207,9 +209,10 @@ void forget_flow(floor_type *floor_ptr)
  *
  * The doors must be INSIDE the allocated region.
  */
-void add_door(floor_type* floor_ptr, POSITION x, POSITION y)
+void add_door(player_type *player_ptr, POSITION x, POSITION y)
 {
        /* Need to have a wall in the center square */
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        if (!is_outer_bold(floor_ptr, y, x)) return;
 
        /* look at:
@@ -225,7 +228,7 @@ void add_door(floor_type* floor_ptr, POSITION x, POSITION y)
                (is_outer_bold(floor_ptr, y, x - 1) && is_outer_bold(floor_ptr, y, x + 1)))
        {
                /* secret door */
-               place_secret_door(floor_ptr, y, x, DOOR_DEFAULT);
+               place_secret_door(player_ptr, y, x, DOOR_DEFAULT);
 
                /* set boundarys so don't get wide doors */
                place_solid_bold(floor_ptr, y, x - 1);
@@ -245,7 +248,7 @@ void add_door(floor_type* floor_ptr, POSITION x, POSITION y)
                is_floor_bold(floor_ptr, y, x - 1) && is_floor_bold(floor_ptr, y, x + 1))
        {
                /* secret door */
-               place_secret_door(floor_ptr, y, x, DOOR_DEFAULT);
+               place_secret_door(player_ptr, y, x, DOOR_DEFAULT);
 
                /* set boundarys so don't get wide doors */
                place_solid_bold(floor_ptr, y - 1, x);
@@ -255,7 +258,7 @@ void add_door(floor_type* floor_ptr, POSITION x, POSITION y)
 
 /*!
  * @brief 所定の位置に上り階段か下り階段を配置する / Place an up/down staircase at given location
-* @param player_ptr プレーヤーへの参照ポインタ
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param y 配置を試みたいマスのY座標
  * @param x 配置を試みたいマスのX座標
  * @return なし
@@ -271,7 +274,7 @@ void place_random_stairs(player_type *player_ptr, POSITION y, POSITION x)
 
        if (!floor_ptr->dun_level) up_stairs = FALSE;
        if (ironman_downward) up_stairs = FALSE;
-       if (floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth) down_stairs = FALSE;
+       if (floor_ptr->dun_level >= d_info[player_ptr->dungeon_idx].maxdepth) down_stairs = FALSE;
        if (quest_number(player_ptr, floor_ptr->dun_level) && (floor_ptr->dun_level > 1)) down_stairs = FALSE;
 
        /* We can't place both */
@@ -658,8 +661,9 @@ bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x)
 /*
  * Change the "feat" flag for a grid, and notice/redraw the grid
  */
-void cave_set_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX feat)
+void cave_set_feat(player_type *player_ptr, POSITION y, POSITION x, FEAT_IDX feat)
 {
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        grid_type *g_ptr = &floor_ptr->grid_array[y][x];
        feature_type *f_ptr = &f_info[feat];
        bool old_los, old_mirror;
@@ -707,12 +711,12 @@ void cave_set_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX feat)
                g_ptr->info &= ~(CAVE_GLOW);
                if (!view_torch_grids) g_ptr->info &= ~(CAVE_MARK);
 
-               update_local_illumination(p_ptr, y, x);
+               update_local_illumination(player_ptr, y, x);
        }
 
        /* Check for change to boring grid */
        if (!have_flag(f_ptr->flags, FF_REMEMBER)) g_ptr->info &= ~(CAVE_MARK);
-       if (g_ptr->m_idx) update_monster(p_ptr, g_ptr->m_idx, FALSE);
+       if (g_ptr->m_idx) update_monster(player_ptr, g_ptr->m_idx, FALSE);
 
        note_spot(y, x);
        lite_spot(y, x);
@@ -723,16 +727,16 @@ void cave_set_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX feat)
 
 #ifdef COMPLEX_WALL_ILLUMINATION /* COMPLEX_WALL_ILLUMINATION */
 
-               update_local_illumination(p_ptr, y, x);
+               update_local_illumination(player_ptr, y, x);
 
 #endif /* COMPLEX_WALL_ILLUMINATION */
 
                /* Update the visuals */
-               p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE | PU_MONSTERS);
+               player_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE | PU_MONSTERS);
        }
 
        /* Hack -- glow the GLOW terrain */
-       if (have_flag(f_ptr->flags, FF_GLOW) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
+       if (have_flag(f_ptr->flags, FF_GLOW) && !(d_info[player_ptr->dungeon_idx].flags1 & DF1_DARKNESS))
        {
                DIRECTION i;
                POSITION yy, xx;
@@ -748,17 +752,17 @@ void cave_set_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX feat)
 
                        if (player_has_los_grid(cc_ptr))
                        {
-                               if (cc_ptr->m_idx) update_monster(p_ptr, cc_ptr->m_idx, FALSE);
+                               if (cc_ptr->m_idx) update_monster(player_ptr, cc_ptr->m_idx, FALSE);
                                note_spot(yy, xx);
                                lite_spot(yy, xx);
                        }
 
-                       update_local_illumination(p_ptr, yy, xx);
+                       update_local_illumination(player_ptr, yy, xx);
                }
 
-               if (p_ptr->special_defense & NINJA_S_STEALTH)
+               if (player_ptr->special_defense & NINJA_S_STEALTH)
                {
-                       if (floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
+                       if (floor_ptr->grid_array[player_ptr->y][player_ptr->x].info & CAVE_GLOW) set_superstealth(player_ptr, FALSE);
                }
        }
 }
@@ -766,15 +770,17 @@ void cave_set_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX feat)
 
 /*!
  * @brief 所定の位置にさまざまな状態や種類のドアを配置する / Place a random type of door at the given location
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param y ドアの配置を試みたいマスのY座標
  * @param x ドアの配置を試みたいマスのX座標
  * @param room 部屋に接している場合向けのドア生成か否か
  * @return なし
  */
-void place_random_door(floor_type *floor_ptr, POSITION y, POSITION x, bool room)
+void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool room)
 {
        int tmp, type;
        FEAT_IDX feat = feat_none;
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        grid_type *g_ptr = &floor_ptr->grid_array[y][x];
 
        /* Initialize mimic info */
@@ -811,7 +817,7 @@ void place_random_door(floor_type *floor_ptr, POSITION y, POSITION x, bool room)
        else if (tmp < 600)
        {
                /* Create secret door */
-               place_closed_door(floor_ptr, y, x, type);
+               place_closed_door(player_ptr, y, x, type);
 
                if (type != DOOR_CURTAIN)
                {
@@ -831,7 +837,7 @@ void place_random_door(floor_type *floor_ptr, POSITION y, POSITION x, bool room)
        }
 
        /* Closed, locked, or stuck doors (400/1000) */
-       else place_closed_door(floor_ptr, y, x, type);
+       else place_closed_door(player_ptr, y, x, type);
 
        if (tmp < 400)
        {
@@ -921,16 +927,18 @@ void wipe_o_list(floor_type *floor_ptr)
 
 /*!
  * @brief 所定の位置に各種の閉じたドアを配置する / Place a random type of normal door at the given location.
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param y ドアの配置を試みたいマスのY座標
  * @param x ドアの配置を試みたいマスのX座標
  * @param type ドアの地形ID
  * @return なし
  */
-void place_closed_door(floor_type *floor_ptr, POSITION y, POSITION x, int type)
+void place_closed_door(player_type *player_ptr, POSITION y, POSITION x, int type)
 {
        int tmp;
        FEAT_IDX feat = feat_none;
 
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        if (d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_DOORS)
        {
                place_floor_bold(floor_ptr, y, x);
@@ -963,7 +971,7 @@ void place_closed_door(floor_type *floor_ptr, POSITION y, POSITION x, int type)
 
        if (feat != feat_none)
        {
-               cave_set_feat(floor_ptr, y, x, feat);
+               cave_set_feat(player_ptr, y, x, feat);
 
                /* Now it is not floor */
                floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK);
@@ -1125,8 +1133,9 @@ static bool possible_doorway(floor_type *floor_ptr, POSITION y, POSITION x)
 * @param x 設置を行いたいマスのX座標
 * @return なし
 */
-void try_door(floor_type *floor_ptr, POSITION y, POSITION x)
+void try_door(player_type *player_ptr, POSITION y, POSITION x)
 {
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        if (!in_bounds(floor_ptr, y, x)) return;
 
        /* Ignore walls */
@@ -1136,10 +1145,10 @@ void try_door(floor_type *floor_ptr, POSITION y, POSITION x)
        if (floor_ptr->grid_array[y][x].info & (CAVE_ROOM)) return;
 
        /* Occasional door (if allowed) */
-       if ((randint0(100) < dun_tun_jct) && possible_doorway(floor_ptr, y, x) && !(d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_DOORS))
+       if ((randint0(100) < dun_tun_jct) && possible_doorway(floor_ptr, y, x) && !(d_info[player_ptr->dungeon_idx].flags1 & DF1_NO_DOORS))
        {
                /* Place a door */
-               place_random_door(floor_ptr, y, x, FALSE);
+               place_random_door(player_ptr, y, x, FALSE);
        }
 }
 
index 94f8e73..8bf3f33 100644 (file)
@@ -375,8 +375,8 @@ extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
 
 extern void update_smell(floor_type *floor_ptr, player_type *subject_ptr);
 
-extern void add_door(floor_type *floor_ptr, POSITION x, POSITION y);
-extern void place_secret_door(floor_type *floor_ptr, POSITION y, POSITION x, int type);
+extern void add_door(player_type *player_ptr, POSITION x, POSITION y);
+extern void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type);
 extern void place_locked_door(player_type *player_ptr, POSITION y, POSITION x);
 extern void forget_flow(floor_type *floor_ptr);
 extern void place_random_stairs(player_type *player_ptr, POSITION y, POSITION x);
@@ -387,15 +387,15 @@ extern int project_length;
 
 extern void vault_monsters(floor_type *floor_ptr, POSITION y1, POSITION x1, int num);
 extern bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x);
-extern void cave_set_feat(floor_type *floor_ptr, POSITION y, POSITION x, FEAT_IDX feat);
-extern void place_random_door(floor_type *floor_ptr, POSITION y, POSITION x, bool room);
-extern void place_closed_door(floor_type *floor_ptr, POSITION y, POSITION x, int type);
+extern void cave_set_feat(player_type *player_ptr, POSITION y, POSITION x, FEAT_IDX feat);
+extern void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool room);
+extern void place_closed_door(player_type *player_ptr, POSITION y, POSITION x, int type);
 
 extern void wipe_o_list(floor_type *floor_ptr);
 extern void vault_trap_aux(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd);
 
 extern bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y);
-extern void try_door(floor_type *floor_ptr, POSITION y, POSITION x);
+extern void try_door(player_type *player_ptr, POSITION y, POSITION x);
 
 extern FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat);
 extern void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num);
index 2c06677..48f0673 100644 (file)
@@ -991,7 +991,7 @@ void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, int action
        if (newfeat == oldfeat) return;
 
        /* Set the new feature */
-       cave_set_feat(floor_ptr, y, x, newfeat);
+       cave_set_feat(player_ptr, y, x, newfeat);
 
        if (!(feature_action_flags[action] & FAF_NO_DROP))
        {
index c4ef52a..04811d9 100644 (file)
@@ -5196,11 +5196,11 @@ void wreck_the_pattern(player_type *creature_ptr)
                if (pattern_tile(r_y, r_x) &&
                        (f_info[floor_ptr->grid_array[r_y][r_x].feat].subtype != PATTERN_TILE_WRECKED))
                {
-                       cave_set_feat(floor_ptr, r_y, r_x, feat_pattern_corrupted);
+                       cave_set_feat(creature_ptr, r_y, r_x, feat_pattern_corrupted);
                }
        }
 
-       cave_set_feat(floor_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_corrupted);
+       cave_set_feat(creature_ptr, creature_ptr->y, creature_ptr->x, feat_pattern_corrupted);
 }
 
 
index 7277363..dc00339 100644 (file)
@@ -292,7 +292,7 @@ void check_quest_completion(player_type *player_ptr, monster_type *m_ptr)
                msg_print(_("魔法の階段が現れた...", "A magical staircase appears..."));
 
                /* Create stairs down */
-               cave_set_feat(floor_ptr, y, x, feat_down_stair);
+               cave_set_feat(player_ptr, y, x, feat_down_stair);
 
                /* Remember to update everything */
                player_ptr->update |= (PU_FLOW);
index dcde92c..0dea40f 100644 (file)
@@ -94,6 +94,7 @@ static bool precalc_ugarcade(int town_hgt, int town_wid, int n)
 
 /*!
 * @brief タイプ16の部屋…地下都市生成のサブルーチン / Actually create buildings
+* @param player_ptr プレーヤーへの参照ポインタ
 * @return なし
 * @param ltcy 生成基準Y座標
 * @param ltcx 生成基準X座標
@@ -102,13 +103,14 @@ static bool precalc_ugarcade(int town_hgt, int town_wid, int n)
 * @note
 * Note: ltcy and ltcx indicate "left top corner".
 */
-static void build_stores(floor_type *floor_ptr, POSITION ltcy, POSITION ltcx, int stores[], int n)
+static void build_stores(player_type *player_ptr, POSITION ltcy, POSITION ltcx, int stores[], int n)
 {
        int i;
        POSITION y, x;
        FEAT_IDX j;
        ugbldg_type *cur_ugbldg;
 
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        for (i = 0; i < n; i++)
        {
                cur_ugbldg = &ugbldg[i];
@@ -168,7 +170,7 @@ static void build_stores(floor_type *floor_ptr, POSITION ltcy, POSITION ltcx, in
                /* Clear previous contents, add a store door */
                if (j < max_f_idx)
                {
-                       cave_set_feat(floor_ptr, ltcy + y, ltcx + x, j);
+                       cave_set_feat(player_ptr, ltcy + y, ltcx + x, j);
 
                        /* Init store */
                        store_init(NO_TOWN, stores[i]);
@@ -191,7 +193,7 @@ static void build_stores(floor_type *floor_ptr, POSITION ltcy, POSITION ltcx, in
 * This function does NOT do anything about the owners of the stores,\n
 * nor the contents thereof.  It only handles the physical layout.\n
 */
-bool build_type16(floor_type *floor_ptr)
+bool build_type16(player_type *player_ptr)
 {
        int stores[] =
        {
@@ -205,6 +207,7 @@ bool build_type16(floor_type *floor_ptr)
        bool prevent_bm = FALSE;
 
        /* Hack -- If already exist black market, prevent building */
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        for (y = 0; (y < floor_ptr->height) && !prevent_bm; y++)
        {
                for (x = 0; x < floor_ptr->width; x++)
@@ -251,7 +254,7 @@ bool build_type16(floor_type *floor_ptr)
                y1 + town_hgt * 2 / 3, x1 + town_wid * 2 / 3, FALSE);
 
        /* Build stores */
-       build_stores(floor_ptr, y1, x1, stores, n);
+       build_stores(player_ptr, y1, x1, stores, n);
 
        msg_print_wizard(CHEAT_DUNGEON, _("地下街を生成しました", "Underground arcade was generated."));
 
index e687f83..b7eb789 100644 (file)
@@ -1,6 +1,6 @@
 #pragma once
 
-extern bool build_type16(floor_type *floor_ptr);
+extern bool build_type16(player_type *player_ptr);
 
 /* Minimum & maximum town size */
 #define MIN_TOWN_WID ((MAX_WID / 3) / 2)
index 4435659..2abea5e 100644 (file)
@@ -9,9 +9,10 @@
 
 /*!
 * @brief タイプ1の部屋…通常可変長方形の部屋を生成する / Type 1 -- normal rectangular rooms
+* @param player_ptr プレーヤーへの参照ポインタ
 * @return なし
 */
-bool build_type1(floor_type *floor_ptr)
+bool build_type1(player_type *player_ptr)
 {
        POSITION y, x, y2, x2, yval, xval;
        POSITION y1, x1, xsize, ysize;
@@ -20,6 +21,7 @@ bool build_type1(floor_type *floor_ptr)
 
        grid_type *g_ptr;
 
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        bool curtain = (d_info[floor_ptr->dungeon_idx].flags1 & DF1_CURTAIN) &&
                one_in_((d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 48 : 512);
 
@@ -195,7 +197,7 @@ bool build_type1(floor_type *floor_ptr)
                        place_solid_bold(floor_ptr, y2 + 1, xval);
                }
 
-               place_random_door(floor_ptr, yval, xval, TRUE);
+               place_random_door(player_ptr, yval, xval, TRUE);
                if (curtain2) floor_ptr->grid_array[yval][xval].feat = feat_door[DOOR_CURTAIN].closed;
        }
 
@@ -488,10 +490,10 @@ bool build_type3(player_type *player_ptr)
                /* Place a secret door on the inner room */
                switch (randint0(4))
                {
-               case 0: place_secret_door(floor_ptr, y1b, xval, DOOR_DEFAULT); break;
-               case 1: place_secret_door(floor_ptr, y2b, xval, DOOR_DEFAULT); break;
-               case 2: place_secret_door(floor_ptr, yval, x1a, DOOR_DEFAULT); break;
-               case 3: place_secret_door(floor_ptr, yval, x2a, DOOR_DEFAULT); break;
+               case 0: place_secret_door(player_ptr, y1b, xval, DOOR_DEFAULT); break;
+               case 1: place_secret_door(player_ptr, y2b, xval, DOOR_DEFAULT); break;
+               case 2: place_secret_door(player_ptr, yval, x1a, DOOR_DEFAULT); break;
+               case 3: place_secret_door(player_ptr, yval, x2a, DOOR_DEFAULT); break;
                }
 
                /* Place a treasure in the vault */
@@ -539,10 +541,10 @@ bool build_type3(player_type *player_ptr)
                                        one_in_((d_info[floor_ptr->dungeon_idx].flags1 & DF1_NO_CAVE) ? 16 : 256)) ? DOOR_CURTAIN :
                                        ((d_info[floor_ptr->dungeon_idx].flags1 & DF1_GLASS_DOOR) ? DOOR_GLASS_DOOR : DOOR_DOOR);
 
-                               place_secret_door(floor_ptr, yval, x1a - 1, door_type);
-                               place_secret_door(floor_ptr, yval, x2a + 1, door_type);
-                               place_secret_door(floor_ptr, y1b - 1, xval, door_type);
-                               place_secret_door(floor_ptr, y2b + 1, xval, door_type);
+                               place_secret_door(player_ptr, yval, x1a - 1, door_type);
+                               place_secret_door(player_ptr, yval, x2a + 1, door_type);
+                               place_secret_door(player_ptr, y1b - 1, xval, door_type);
+                               place_secret_door(player_ptr, y2b + 1, xval, door_type);
                        }
                }
 
@@ -668,10 +670,10 @@ bool build_type4(player_type *player_ptr)
                        /* Place a secret door */
                        switch (randint1(4))
                        {
-                       case 1: place_secret_door(floor_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
-                       case 2: place_secret_door(floor_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
-                       case 3: place_secret_door(floor_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
-                       case 4: place_secret_door(floor_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
+                       case 1: place_secret_door(player_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
+                       case 2: place_secret_door(player_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
+                       case 3: place_secret_door(player_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
+                       case 4: place_secret_door(player_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
                        }
 
                        /* Place a monster in the room */
@@ -686,10 +688,10 @@ bool build_type4(player_type *player_ptr)
                        /* Place a secret door */
                        switch (randint1(4))
                        {
-                       case 1: place_secret_door(floor_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
-                       case 2: place_secret_door(floor_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
-                       case 3: place_secret_door(floor_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
-                       case 4: place_secret_door(floor_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
+                       case 1: place_secret_door(player_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
+                       case 2: place_secret_door(player_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
+                       case 3: place_secret_door(player_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
+                       case 4: place_secret_door(player_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
                        }
 
                        /* Place another inner room */
@@ -739,10 +741,10 @@ bool build_type4(player_type *player_ptr)
                        /* Place a secret door */
                        switch (randint1(4))
                        {
-                       case 1: place_secret_door(floor_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
-                       case 2: place_secret_door(floor_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
-                       case 3: place_secret_door(floor_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
-                       case 4: place_secret_door(floor_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
+                       case 1: place_secret_door(player_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
+                       case 2: place_secret_door(player_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
+                       case 3: place_secret_door(player_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
+                       case 4: place_secret_door(player_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
                        }
 
                        /* Large Inner Pillar */
@@ -797,8 +799,8 @@ bool build_type4(player_type *player_ptr)
                                place_inner_grid(g_ptr);
 
                                /* Secret doors (random top/bottom) */
-                               place_secret_door(floor_ptr, yval - 3 + (randint1(2) * 2), xval - 3, door_type);
-                               place_secret_door(floor_ptr, yval - 3 + (randint1(2) * 2), xval + 3, door_type);
+                               place_secret_door(player_ptr, yval - 3 + (randint1(2) * 2), xval - 3, door_type);
+                               place_secret_door(player_ptr, yval - 3 + (randint1(2) * 2), xval + 3, door_type);
 
                                /* Monsters */
                                vault_monsters(floor_ptr, yval, xval - 2, randint1(2));
@@ -818,10 +820,10 @@ bool build_type4(player_type *player_ptr)
                        /* Place a secret door */
                        switch (randint1(4))
                        {
-                       case 1: place_secret_door(floor_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
-                       case 2: place_secret_door(floor_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
-                       case 3: place_secret_door(floor_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
-                       case 4: place_secret_door(floor_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
+                       case 1: place_secret_door(player_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
+                       case 2: place_secret_door(player_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
+                       case 3: place_secret_door(player_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
+                       case 4: place_secret_door(player_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
                        }
 
                        /* Maze (really a checkerboard) */
@@ -874,18 +876,18 @@ bool build_type4(player_type *player_ptr)
                        if (randint0(100) < 50)
                        {
                                int i = randint1(10);
-                               place_secret_door(floor_ptr, y1 - 1, xval - i, door_type);
-                               place_secret_door(floor_ptr, y1 - 1, xval + i, door_type);
-                               place_secret_door(floor_ptr, y2 + 1, xval - i, door_type);
-                               place_secret_door(floor_ptr, y2 + 1, xval + i, door_type);
+                               place_secret_door(player_ptr, y1 - 1, xval - i, door_type);
+                               place_secret_door(player_ptr, y1 - 1, xval + i, door_type);
+                               place_secret_door(player_ptr, y2 + 1, xval - i, door_type);
+                               place_secret_door(player_ptr, y2 + 1, xval + i, door_type);
                        }
                        else
                        {
                                int i = randint1(3);
-                               place_secret_door(floor_ptr, yval + i, x1 - 1, door_type);
-                               place_secret_door(floor_ptr, yval - i, x1 - 1, door_type);
-                               place_secret_door(floor_ptr, yval + i, x2 + 1, door_type);
-                               place_secret_door(floor_ptr, yval - i, x2 + 1, door_type);
+                               place_secret_door(player_ptr, yval + i, x1 - 1, door_type);
+                               place_secret_door(player_ptr, yval - i, x1 - 1, door_type);
+                               place_secret_door(player_ptr, yval + i, x2 + 1, door_type);
+                               place_secret_door(player_ptr, yval - i, x2 + 1, door_type);
                        }
 
                        /* Treasure, centered at the center of the cross */
@@ -1035,7 +1037,7 @@ bool build_type12(player_type *player_ptr)
        if (emptyflag && one_in_(2))
        {
                /* Build the vault */
-               build_small_room(floor_ptr, x0, y0);
+               build_small_room(player_ptr, x0, y0);
 
                /* Place a treasure in the vault */
                place_object(player_ptr, y0, x0, 0L);
index 6fa1775..e3507c8 100644 (file)
@@ -265,6 +265,7 @@ static vault_aux_type pit_types[] =
 
 /*!
 * @brief タイプ5の部屋…nestを生成する / Type 5 -- Monster nests
+* @param player_ptr プレーヤーへの参照ポインタ
 * @return なし
 * @details
 * A monster nest is a "big" room, with an "inner" room, containing\n
@@ -283,7 +284,7 @@ static vault_aux_type pit_types[] =
 *\n
 * Note that "monster nests" will never contain "unique" monsters.\n
 */
-bool build_type5(floor_type *floor_ptr)
+bool build_type5(player_type *player_ptr)
 {
        POSITION y, x, y1, x1, y2, x2, xval, yval;
        int i;
@@ -293,6 +294,7 @@ bool build_type5(floor_type *floor_ptr)
 
        grid_type *g_ptr;
 
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        int cur_nest_type = pick_vault_type(floor_ptr, nest_types, d_info[floor_ptr->dungeon_idx].nest);
        vault_aux_type *n_ptr;
 
@@ -408,10 +410,10 @@ bool build_type5(floor_type *floor_ptr)
        /* Place a secret door */
        switch (randint1(4))
        {
-       case 1: place_secret_door(floor_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
-       case 2: place_secret_door(floor_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
-       case 3: place_secret_door(floor_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
-       case 4: place_secret_door(floor_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
+       case 1: place_secret_door(player_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
+       case 2: place_secret_door(player_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
+       case 3: place_secret_door(player_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
+       case 4: place_secret_door(player_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
        }
 
        msg_format_wizard(CHEAT_DUNGEON, _("モンスター部屋(nest)(%s%s)を生成します。", "Monster nest (%s%s)"), n_ptr->name, pit_subtype_string(cur_nest_type, TRUE));
@@ -491,7 +493,7 @@ bool build_type5(floor_type *floor_ptr)
 *\n
 * Note that "monster pits" will never contain "unique" monsters.\n
 */
-bool build_type6(floor_type *floor_ptr)
+bool build_type6(player_type *player_ptr)
 {
        POSITION y, x, y1, x1, y2, x2, xval, yval;
        int i, j;
@@ -502,6 +504,7 @@ bool build_type6(floor_type *floor_ptr)
 
        grid_type *g_ptr;
 
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        int cur_pit_type = pick_vault_type(floor_ptr, pit_types, d_info[floor_ptr->dungeon_idx].pit);
        vault_aux_type *n_ptr;
 
@@ -614,10 +617,10 @@ bool build_type6(floor_type *floor_ptr)
        /* Place a secret door */
        switch (randint1(4))
        {
-       case 1: place_secret_door(floor_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
-       case 2: place_secret_door(floor_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
-       case 3: place_secret_door(floor_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
-       case 4: place_secret_door(floor_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
+       case 1: place_secret_door(player_ptr, y1 - 1, xval, DOOR_DEFAULT); break;
+       case 2: place_secret_door(player_ptr, y2 + 1, xval, DOOR_DEFAULT); break;
+       case 3: place_secret_door(player_ptr, yval, x1 - 1, DOOR_DEFAULT); break;
+       case 4: place_secret_door(player_ptr, yval, x2 + 1, DOOR_DEFAULT); break;
        }
 
        /* Sort the entries */
index 140e4f4..7c9547a 100644 (file)
@@ -7,6 +7,6 @@ typedef struct
 }
 nest_mon_info_type;
 
-extern bool build_type5(floor_type *floor_ptr);
-extern bool build_type6(floor_type *floor_ptr);
+extern bool build_type5(player_type *player_ptr);
+extern bool build_type6(player_type *player_ptr);
 extern bool build_type13(floor_type *floor_ptr);
index f052ede..8aecef3 100644 (file)
@@ -115,7 +115,7 @@ bool build_type15(player_type *player_ptr)
                dir1 = randint0(4);
                y = yval + 2 * ddy_ddd[dir1];
                x = xval + 2 * ddx_ddd[dir1];
-               place_secret_door(floor_ptr, y, x, DOOR_GLASS_DOOR);
+               place_secret_door(player_ptr, y, x, DOOR_GLASS_DOOR);
                g_ptr = &floor_ptr->grid_array[y][x];
                if (is_closed_door(g_ptr->feat)) g_ptr->mimic = feat_glass_wall;
 
@@ -163,13 +163,13 @@ bool build_type15(player_type *player_ptr)
                /* Curtains around the breather */
                for (y = yval - 1; y <= yval + 1; y++)
                {
-                       place_closed_door(floor_ptr, y, xval - 2, DOOR_CURTAIN);
-                       place_closed_door(floor_ptr, y, xval + 2, DOOR_CURTAIN);
+                       place_secret_door(player_ptr, y, xval - 2, DOOR_CURTAIN);
+                       place_secret_door(player_ptr, y, xval + 2, DOOR_CURTAIN);
                }
                for (x = xval - 1; x <= xval + 1; x++)
                {
-                       place_closed_door(floor_ptr, yval - 2, x, DOOR_CURTAIN);
-                       place_closed_door(floor_ptr, yval + 2, x, DOOR_CURTAIN);
+                       place_secret_door(player_ptr, yval - 2, x, DOOR_CURTAIN);
+                       place_secret_door(player_ptr, yval + 2, x, DOOR_CURTAIN);
                }
 
                /* Place an object */
index 24884f4..fdcf8aa 100644 (file)
@@ -161,7 +161,7 @@ static void build_bubble_vault(player_type *player_ptr, POSITION x0, POSITION y0
        {
                x = randint1(xsize - 3) - xhsize + x0 + 1;
                y = randint1(ysize - 3) - yhsize + y0 + 1;
-               add_door(floor_ptr, x, y);
+               add_door(player_ptr, x, y);
        }
 
        /* Fill with monsters and treasure, low difficulty */
@@ -210,7 +210,7 @@ static void build_room_vault(player_type *player_ptr, POSITION x0, POSITION y0,
        {
                x1 = randint1(xsize - 3) - xhsize + x0 + 1;
                y1 = randint1(ysize - 3) - yhsize + y0 + 1;
-               add_door(floor_ptr, x1, y1);
+               add_door(player_ptr, x1, y1);
        }
 
        /* Fill with monsters and treasure, high difficulty */
@@ -426,18 +426,18 @@ static void build_vault(player_type *player_ptr, POSITION yval, POSITION xval, P
 
                                /* Secret doors */
                        case '+':
-                               place_secret_door(floor_ptr, y, x, DOOR_DEFAULT);
+                               place_secret_door(player_ptr, y, x, DOOR_DEFAULT);
                                break;
 
                                /* Secret glass doors */
                        case '-':
-                               place_secret_door(floor_ptr, y, x, DOOR_GLASS_DOOR);
+                               place_secret_door(player_ptr, y, x, DOOR_GLASS_DOOR);
                                if (is_closed_door(g_ptr->feat)) g_ptr->mimic = feat_glass_wall;
                                break;
 
                                /* Curtains */
                        case '\'':
-                               place_secret_door(floor_ptr, y, x, DOOR_CURTAIN);
+                               place_secret_door(player_ptr, y, x, DOOR_CURTAIN);
                                break;
 
                                /* Trap */
@@ -912,14 +912,14 @@ static void build_target_vault(player_type *player_ptr, POSITION x0, POSITION y0
        x = (rad - 2) / 4 + 1;
        y = rad / 2 + x;
 
-       add_door(floor_ptr, x0 + x, y0);
-       add_door(floor_ptr, x0 + y, y0);
-       add_door(floor_ptr, x0 - x, y0);
-       add_door(floor_ptr, x0 - y, y0);
-       add_door(floor_ptr, x0, y0 + x);
-       add_door(floor_ptr, x0, y0 + y);
-       add_door(floor_ptr, x0, y0 - x);
-       add_door(floor_ptr, x0, y0 - y);
+       add_door(player_ptr, x0 + x, y0);
+       add_door(player_ptr, x0 + y, y0);
+       add_door(player_ptr, x0 - x, y0);
+       add_door(player_ptr, x0 - y, y0);
+       add_door(player_ptr, x0, y0 + x);
+       add_door(player_ptr, x0, y0 + y);
+       add_door(player_ptr, x0, y0 - x);
+       add_door(player_ptr, x0, y0 - y);
 
        /* Fill with stuff - medium difficulty */
        fill_treasure(player_ptr, x0 - rad, x0 + rad, y0 - rad, y0 + rad, randint1(3) + 3);
@@ -1010,7 +1010,7 @@ static void build_elemental_vault(player_type *player_ptr, POSITION x0, POSITION
        /* make a few rooms in the vault */
        for (i = 1; i <= (xsize * ysize) / 50; i++)
        {
-               build_small_room(floor_ptr, x0 + randint0(xsize - 4) - xsize / 2 + 2,
+               build_small_room(player_ptr, x0 + randint0(xsize - 4) - xsize / 2 + 2,
                        y0 + randint0(ysize - 4) - ysize / 2 + 2);
        }
 
index 50b1a46..c9b91cc 100644 (file)
@@ -153,7 +153,7 @@ static byte room_build_order[ROOM_T_MAX] = {
 
 /*!
  * @brief 1マスだけの部屋を作成し、上下左右いずれか一つに隠しドアを配置する。
- * @param floor_ptr 配置するフロアの参照ポインタ
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param y0 配置したい中心のY座標
  * @param x0 配置したい中心のX座標
  * @details
@@ -163,10 +163,11 @@ static byte room_build_order[ROOM_T_MAX] = {
  * Note - this should be used only on allocated regions
  * within another room.
  */
-void build_small_room(floor_type *floor_ptr, POSITION x0, POSITION y0)
+void build_small_room(player_type *player_ptr, POSITION x0, POSITION y0)
 {
        POSITION x, y;
 
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        for (y = y0 - 1; y <= y0 + 1; y++)
        {
                place_inner_bold(floor_ptr, y, x0 - 1);
@@ -182,10 +183,10 @@ void build_small_room(floor_type *floor_ptr, POSITION x0, POSITION y0)
        /* Place a secret door on one side */
        switch (randint0(4))
        {
-               case 0: place_secret_door(floor_ptr, y0, x0 - 1, DOOR_DEFAULT); break;
-               case 1: place_secret_door(floor_ptr, y0, x0 + 1, DOOR_DEFAULT); break;
-               case 2: place_secret_door(floor_ptr, y0 - 1, x0, DOOR_DEFAULT); break;
-               case 3: place_secret_door(floor_ptr, y0 + 1, x0, DOOR_DEFAULT); break;
+               case 0: place_secret_door(player_ptr, y0, x0 - 1, DOOR_DEFAULT); break;
+               case 1: place_secret_door(player_ptr, y0, x0 + 1, DOOR_DEFAULT); break;
+               case 2: place_secret_door(player_ptr, y0 - 1, x0, DOOR_DEFAULT); break;
+               case 3: place_secret_door(player_ptr, y0 + 1, x0, DOOR_DEFAULT); break;
        }
 
        /* Clear mimic type */
@@ -2092,8 +2093,8 @@ static bool room_build(player_type *player_ptr, EFFECT_ID typ)
        case ROOM_T_OVERLAP:       return build_type2(floor_ptr);
        case ROOM_T_CROSS:         return build_type3(player_ptr);
        case ROOM_T_INNER_FEAT:    return build_type4(player_ptr);
-       case ROOM_T_NEST:          return build_type5(floor_ptr);
-       case ROOM_T_PIT:           return build_type6(floor_ptr);
+       case ROOM_T_NEST:          return build_type5(player_ptr);
+       case ROOM_T_PIT:           return build_type6(player_ptr);
        case ROOM_T_LESSER_VAULT:  return build_type7(player_ptr);
        case ROOM_T_GREATER_VAULT: return build_type8(player_ptr);
        case ROOM_T_FRACAVE:       return build_type9(floor_ptr);
@@ -2103,7 +2104,7 @@ static bool room_build(player_type *player_ptr, EFFECT_ID typ)
        case ROOM_T_TRAP_PIT:      return build_type13(floor_ptr);
        case ROOM_T_TRAP:          return build_type14(floor_ptr);
        case ROOM_T_GLASS:         return build_type15(player_ptr);
-       case ROOM_T_ARCADE:        return build_type16(floor_ptr);
+       case ROOM_T_ARCADE:        return build_type16(player_ptr);
        case ROOM_T_FIXED:         return build_type17(player_ptr);
        }
        return FALSE;
index 172da0a..69f426a 100644 (file)
@@ -91,7 +91,7 @@ door_type feat_door[MAX_DOOR_TYPES];
 extern bool generate_rooms(player_type *player_ptr);
 extern void build_maze_vault(player_type *player_ptr, POSITION x0, POSITION y0, POSITION xsize, POSITION ysize, bool is_vault);
 extern bool find_space(floor_type *floor_ptr, POSITION *y, POSITION *x, POSITION height, POSITION width);
-extern void build_small_room(floor_type *floor_ptr, POSITION x0, POSITION y0);
+extern void build_small_room(player_type *player_ptr, POSITION x0, POSITION y0);
 extern void add_outer_wall(floor_type *floor_ptr, POSITION x, POSITION y, int light, POSITION x1, POSITION y1, POSITION x2, POSITION y2);
 extern POSITION dist2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, POSITION h1, POSITION h2, POSITION h3, POSITION h4);
 extern void generate_room_floor(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light);
index 43b2f3a..82a4b13 100644 (file)
@@ -331,7 +331,7 @@ void stair_creation(player_type *caster_ptr)
 
                                /* Remove old stairs */
                                g_ptr->special = 0;
-                               cave_set_feat(floor_ptr, y, x, feat_ground_type[randint0(100)]);
+                               cave_set_feat(caster_ptr, y, x, feat_ground_type[randint0(100)]);
                        }
                }
        }
@@ -355,13 +355,13 @@ void stair_creation(player_type *caster_ptr)
        /* Create a staircase */
        if (up)
        {
-               cave_set_feat(floor_ptr, caster_ptr->y, caster_ptr->x,
+               cave_set_feat(caster_ptr, caster_ptr->y, caster_ptr->x,
                        (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level <= floor_ptr->dun_level - 2)) ?
                        feat_state(feat_up_stair, FF_SHAFT) : feat_up_stair);
        }
        else
        {
-               cave_set_feat(floor_ptr, caster_ptr->y, caster_ptr->x,
+               cave_set_feat(caster_ptr, caster_ptr->y, caster_ptr->x,
                        (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level >= floor_ptr->dun_level + 2)) ?
                        feat_state(feat_down_stair, FF_SHAFT) : feat_down_stair);
        }
@@ -577,22 +577,22 @@ bool destroy_area(player_type *caster_ptr, POSITION y1, POSITION x1, POSITION r,
                                if (t < 20)
                                {
                                        /* Create granite wall */
-                                       cave_set_feat(floor_ptr, y, x, feat_granite);
+                                       cave_set_feat(caster_ptr, y, x, feat_granite);
                                }
                                else if (t < 70)
                                {
                                        /* Create quartz vein */
-                                       cave_set_feat(floor_ptr, y, x, feat_quartz_vein);
+                                       cave_set_feat(caster_ptr, y, x, feat_quartz_vein);
                                }
                                else if (t < 100)
                                {
                                        /* Create magma vein */
-                                       cave_set_feat(floor_ptr, y, x, feat_magma_vein);
+                                       cave_set_feat(caster_ptr, y, x, feat_magma_vein);
                                }
                                else
                                {
                                        /* Create floor */
-                                       cave_set_feat(floor_ptr, y, x, feat_ground_type[randint0(100)]);
+                                       cave_set_feat(caster_ptr, y, x, feat_ground_type[randint0(100)]);
                                }
 
                                continue;
@@ -1056,26 +1056,26 @@ bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, M
                        /* Create granite wall */
                        if (t < 20)
                        {
-                               cave_set_feat(floor_ptr, yy, xx, feat_granite);
+                               cave_set_feat(caster_ptr, yy, xx, feat_granite);
                                continue;
                        }
 
                        /* Create quartz vein */
                        if (t < 70)
                        {
-                               cave_set_feat(floor_ptr, yy, xx, feat_quartz_vein);
+                               cave_set_feat(caster_ptr, yy, xx, feat_quartz_vein);
                                continue;
                        }
 
                        /* Create magma vein */
                        if (t < 100)
                        {
-                               cave_set_feat(floor_ptr, yy, xx, feat_magma_vein);
+                               cave_set_feat(caster_ptr, yy, xx, feat_magma_vein);
                                continue;
                        }
 
                        /* Create floor */
-                       cave_set_feat(floor_ptr, yy, xx, feat_ground_type[randint0(100)]);
+                       cave_set_feat(caster_ptr, yy, xx, feat_ground_type[randint0(100)]);
                }
        }
 
index cc0e1e6..a827770 100644 (file)
@@ -321,7 +321,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                if (message)
                {
                        msg_format(_("木は%s。", "A tree %s"), message);
-                       cave_set_feat(floor_ptr, y, x, one_in_(3) ? feat_brake : feat_grass);
+                       cave_set_feat(caster_ptr, y, x, one_in_(3) ? feat_brake : feat_grass);
 
                        /* Observe */
                        if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
@@ -498,7 +498,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                {
                        if (!cave_naked_bold(caster_ptr, floor_ptr, y, x)) break;
                        if (player_bold(caster_ptr, y, x)) break;
-                       cave_set_feat(floor_ptr, y, x, feat_door[DOOR_DOOR].closed);
+                       cave_set_feat(caster_ptr, y, x, feat_door[DOOR_DOOR].closed);
                        if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
                        break;
                }
@@ -513,7 +513,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                {
                        if (!cave_naked_bold(caster_ptr, floor_ptr, y, x)) break;
                        if (player_bold(caster_ptr, y, x)) break;
-                       cave_set_feat(floor_ptr, y, x, feat_tree);
+                       cave_set_feat(caster_ptr, y, x, feat_tree);
                        if (g_ptr->info & (CAVE_MARK)) obvious = TRUE;
                        break;
                }
@@ -532,7 +532,7 @@ if (have_flag(f_ptr->flags, FF_TREE))
                {
                        if (!cave_naked_bold(caster_ptr, floor_ptr, y, x)) break;
                        if (player_bold(caster_ptr, y, x)) break;
-                       cave_set_feat(floor_ptr, y, x, feat_granite);
+                       cave_set_feat(caster_ptr, y, x, feat_granite);
                        break;
                }
 
@@ -542,11 +542,11 @@ if (have_flag(f_ptr->flags, FF_TREE))
                        if (dam == 1)
                        {
                                if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
-                               cave_set_feat(floor_ptr, y, x, feat_shallow_lava);
+                               cave_set_feat(caster_ptr, y, x, feat_shallow_lava);
                        }
                        else if (dam)
                        {
-                               cave_set_feat(floor_ptr, y, x, feat_deep_lava);
+                               cave_set_feat(caster_ptr, y, x, feat_deep_lava);
                        }
 
                        break;
@@ -558,11 +558,11 @@ if (have_flag(f_ptr->flags, FF_TREE))
                        if (dam == 1)
                        {
                                if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
-                               cave_set_feat(floor_ptr, y, x, feat_shallow_water);
+                               cave_set_feat(caster_ptr, y, x, feat_shallow_water);
                        }
                        else if (dam)
                        {
-                               cave_set_feat(floor_ptr, y, x, feat_deep_water);
+                               cave_set_feat(caster_ptr, y, x, feat_deep_water);
                        }
 
                        break;
index 2cc31ea..bb50f61 100644 (file)
@@ -1613,7 +1613,7 @@ static void do_cmd_wiz_create_feature(player_type *creature_ptr)
        if (tmp_mimic < 0) tmp_mimic = 0;
        else if (tmp_mimic >= max_f_idx) tmp_mimic = max_f_idx - 1;
 
-       cave_set_feat(creature_ptr->current_floor_ptr, y, x, tmp_feat);
+       cave_set_feat(creature_ptr, y, x, tmp_feat);
        g_ptr->mimic = (s16b)tmp_mimic;
 
        feature_type *f_ptr;