OSDN Git Service

[Refactor] #38997 lite_spot() にplayer_type * 引数を追加 / Added player_type * argument...
authorHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 11:46:52 +0000 (20:46 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 18 Jan 2020 14:01:53 +0000 (23:01 +0900)
29 files changed:
src/autopick.c
src/birth.c
src/cmd/cmd-basic.c
src/cmd/cmd-item.c
src/cmd/cmd-pet.c
src/combat/shoot.c
src/core.c
src/floor-save.c
src/floor-streams.c
src/floor.c
src/grid.c
src/grid.h
src/mind.c
src/monster-process.c
src/monster-status.c
src/monster2.c
src/object.h
src/object2.c
src/player-effects.c
src/player-inventory.c
src/player-move.c
src/realm-hissatsu.c
src/spells-floor.c
src/spells1.c
src/spells2.c
src/spells3.c
src/trap.c
src/view-mainwindow.c
src/wizard2.c

index 94720ab..e64a8ef 100644 (file)
@@ -2061,7 +2061,7 @@ static void autopick_delayed_alter_aux(player_type *player_ptr, INVENTORY_IDX it
        /* Eliminate the item (from the floor) */
        else
        {
-               delete_object_idx(player_ptr->current_floor_ptr, 0 - item);
+               delete_object_idx(player_ptr, 0 - item);
        }
 
        msg_format(_("%sを自動破壊します。", "Auto-destroying %s."), o_name);
index fb55623..903dc46 100644 (file)
@@ -1992,7 +1992,7 @@ static void wield_all(player_type *creature_ptr)
                else
                {
                        floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
-                       floor_item_optimize(creature_ptr->current_floor_ptr, 0 - item);
+                       floor_item_optimize(creature_ptr, 0 - item);
                }
 
                o_ptr = &creature_ptr->inventory_list[slot];
index d5b1bdf..1f054c6 100644 (file)
@@ -2471,7 +2471,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
        else
        {
                floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
-               floor_item_optimize(creature_ptr->current_floor_ptr, 0 - item);
+               floor_item_optimize(creature_ptr, 0 - item);
        }
 
        if (item >= INVEN_RARM)
@@ -2534,7 +2534,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                        move_cursor_relative(ny[cur_dis], nx[cur_dis]);
                        Term_fresh();
                        Term_xtra(TERM_XTRA_DELAY, msec);
-                       lite_spot(ny[cur_dis], nx[cur_dis]);
+                       lite_spot(creature_ptr, ny[cur_dis], nx[cur_dis]);
                        Term_fresh();
                }
 
@@ -2731,7 +2731,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                                        move_cursor_relative(ny[i], nx[i]);
                                        Term_fresh();
                                        Term_xtra(TERM_XTRA_DELAY, msec);
-                                       lite_spot(ny[i], nx[i]);
+                                       lite_spot(creature_ptr, ny[i], nx[i]);
                                        Term_fresh();
                                }
                                else
index 58feb1a..18db992 100644 (file)
@@ -347,7 +347,7 @@ void do_cmd_wield(player_type *creature_ptr)
        else
        {
                floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
-               floor_item_optimize(creature_ptr->current_floor_ptr, 0 - item);
+               floor_item_optimize(creature_ptr, 0 - item);
        }
 
        /* Access the wield slot */
index 6464dfd..dd74668 100644 (file)
@@ -1059,10 +1059,10 @@ bool rakuba(player_type *creature_ptr, HIT_POINT dam, bool force)
                creature_ptr->x = sx;
 
                /* Redraw the old spot */
-               lite_spot(oy, ox);
+               lite_spot(creature_ptr, oy, ox);
 
                /* Redraw the new spot */
-               lite_spot(creature_ptr->y, creature_ptr->x);
+               lite_spot(creature_ptr, creature_ptr->y, creature_ptr->x);
 
                /* Check for new panel */
                verify_panel(creature_ptr);
index 5da3b4f..c39d590 100644 (file)
@@ -551,7 +551,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
                        {
                                shooter_ptr->current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW);
                                note_spot(shooter_ptr, ny, nx);
-                               lite_spot(ny, nx);
+                               lite_spot(shooter_ptr, ny, nx);
                        }
 
                        /* The player can see the (on screen) missile */
@@ -565,7 +565,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
                                move_cursor_relative(ny, nx);
                                Term_fresh();
                                Term_xtra(TERM_XTRA_DELAY, msec);
-                               lite_spot(ny, nx);
+                               lite_spot(shooter_ptr, ny, nx);
                                Term_fresh();
                        }
 
@@ -588,7 +588,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
                        {
                                shooter_ptr->current_floor_ptr->grid_array[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
                                note_spot(shooter_ptr, ny, nx);
-                               lite_spot(ny, nx);
+                               lite_spot(shooter_ptr, ny, nx);
                        }
 
                        prev_y = y;
@@ -724,7 +724,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
                                        {
                                                shooter_ptr->current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW);
                                                note_spot(shooter_ptr, ny, nx);
-                                               lite_spot(ny, nx);
+                                               lite_spot(shooter_ptr, ny, nx);
                                        }
 
                                        /* Hit the monster, check for death */
@@ -796,8 +796,8 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr,
 
                                                                update_monster(shooter_ptr, c_mon_ptr->m_idx, TRUE);
 
-                                                               lite_spot(ny, nx);
-                                                               lite_spot(oy, ox);
+                                                               lite_spot(shooter_ptr, ny, nx);
+                                                               lite_spot(shooter_ptr, oy, ox);
 
                                                                Term_fresh();
                                                                Term_xtra(TERM_XTRA_DELAY, msec);
index 1b6af4d..a8f6371 100644 (file)
@@ -4775,7 +4775,7 @@ static void process_player(player_type *creature_ptr)
                                        continue;
 
                                /* Redraw regardless */
-                               lite_spot(m_ptr->fy, m_ptr->fx);
+                               lite_spot(creature_ptr, m_ptr->fy, m_ptr->fx);
                        }
 
 
@@ -4826,7 +4826,7 @@ static void process_player(player_type *creature_ptr)
                                                        if (creature_ptr->riding == m_idx) creature_ptr->redraw |= (PR_UHEALTH);
 
                                                        /* Redraw regardless */
-                                                       lite_spot(m_ptr->fy, m_ptr->fx);
+                                                       lite_spot(creature_ptr, m_ptr->fy, m_ptr->fx);
                                                }
                                        }
                                }
index cf78a76..babd1d5 100644 (file)
@@ -617,7 +617,7 @@ static void place_pet(player_type *master_ptr)
                                repair_monsters = TRUE;
                        }
                        update_monster(master_ptr, m_idx, TRUE);
-                       lite_spot(cy, cx);
+                       lite_spot(master_ptr, cy, cx);
 
                        /* Pre-calculated in precalc_cur_num_of_pet() */
                        /* r_ptr->cur_num++; */
@@ -1272,7 +1272,7 @@ void change_floor(player_type *creature_ptr)
                                if (a_info[o_ptr->name1].floor_id != new_floor_id)
                                {
                                        /* Disappear from here */
-                                       delete_object_idx(creature_ptr->current_floor_ptr, i);
+                                       delete_object_idx(creature_ptr, i);
                                }
                                else
                                {
index 90c496b..a8b6532 100644 (file)
@@ -331,7 +331,7 @@ void build_streamer(player_type *player_ptr, FEAT_IDX feat, int chance)
                                        }
                                }
 
-                               delete_object(floor_ptr, ty, tx);
+                               delete_object(player_ptr, ty, tx);
                        }
 
                        /* Clear previous contents, add proper vein type */
index d45ad96..dc1e51d 100644 (file)
@@ -677,7 +677,7 @@ void cave_set_feat(player_type *player_ptr, POSITION y, POSITION x, FEAT_IDX fea
        if (g_ptr->m_idx) update_monster(player_ptr, g_ptr->m_idx, FALSE);
 
        note_spot(player_ptr, y, x);
-       lite_spot(y, x);
+       lite_spot(player_ptr, y, x);
 
        /* Check if los has changed */
        if (old_los ^ have_flag(f_ptr->flags, FF_LOS))
@@ -711,7 +711,7 @@ void cave_set_feat(player_type *player_ptr, POSITION y, POSITION x, FEAT_IDX fea
                {
                        if (cc_ptr->m_idx) update_monster(player_ptr, cc_ptr->m_idx, FALSE);
                        note_spot(player_ptr, yy, xx);
-                       lite_spot(yy, xx);
+                       lite_spot(player_ptr, yy, xx);
                }
 
                update_local_illumination(player_ptr, yy, xx);
@@ -1604,7 +1604,7 @@ void place_object(player_type *owner_ptr, POSITION y, POSITION x, BIT_FLAGS mode
 
        g_ptr->o_idx = o_idx;
        note_spot(owner_ptr, y, x);
-       lite_spot(y, x);
+       lite_spot(owner_ptr, y, x);
 }
 
 
@@ -1659,7 +1659,7 @@ void place_gold(player_type *player_ptr, POSITION y, POSITION x)
 
        g_ptr->o_idx = o_idx;
        note_spot(player_ptr, y, x);
-       lite_spot(y, x);
+       lite_spot(player_ptr, y, x);
 }
 
 
@@ -1836,7 +1836,7 @@ void compact_objects(player_type *player_ptr, int size)
                        /* Apply the saving throw */
                        if (randint0(100) < chance) continue;
 
-                       delete_object_idx(floor_ptr, i);
+                       delete_object_idx(player_ptr, i);
                        num++;
                }
        }
index 1e03ae9..21aaf7c 100644 (file)
@@ -339,7 +339,7 @@ bool check_local_illumination(player_type *creature_ptr, POSITION y, POSITION x)
 \
                /* Notice and redraw */ \
                note_spot((C), (Y), (X)); \
-               lite_spot((Y), (X)); \
+               lite_spot((C), (Y), (X)); \
        } \
 }
 
@@ -606,31 +606,31 @@ void note_spot(player_type *player_ptr, POSITION y, POSITION x)
  *
  * This function should only be called on "legal" grids
  */
-void lite_spot(POSITION y, POSITION x)
+void lite_spot(player_type *player_ptr, POSITION y, POSITION x)
 {
        /* Redraw if on screen */
-       if (panel_contains(y, x) && in_bounds2(p_ptr->current_floor_ptr, y, x))
+       if (panel_contains(y, x) && in_bounds2(player_ptr->current_floor_ptr, y, x))
        {
                TERM_COLOR a;
                SYMBOL_CODE c;
                TERM_COLOR ta;
                SYMBOL_CODE tc;
 
-               map_info(p_ptr, y, x, &a, &c, &ta, &tc);
+               map_info(player_ptr, y, x, &a, &c, &ta, &tc);
 
                /* Hack -- fake monochrome */
                if (!use_graphics)
                {
                        if (current_world_ptr->timewalk_m_idx) a = TERM_DARK;
-                       else if (IS_INVULN(p_ptr) || p_ptr->timewalk) a = TERM_WHITE;
-                       else if (p_ptr->wraith_form) a = TERM_L_DARK;
+                       else if (IS_INVULN(player_ptr) || player_ptr->timewalk) a = TERM_WHITE;
+                       else if (player_ptr->wraith_form) a = TERM_L_DARK;
                }
 
                /* Hack -- Queue it */
                Term_queue_bigchar(panel_col_of(x), y - panel_row_prt, a, c, ta, tc);
 
                /* Update sub-windows */
-               p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
+               player_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
        }
 }
 
@@ -1053,7 +1053,7 @@ void remove_mirror(player_type *caster_ptr, POSITION y, POSITION x)
 
        note_spot(caster_ptr, y, x);
 
-       lite_spot(y, x);
+       lite_spot(caster_ptr, y, x);
 }
 
 
index 005be8e..da87883 100644 (file)
@@ -190,7 +190,7 @@ extern void update_local_illumination(player_type *creature_ptr, POSITION y, POS
 extern bool no_lite(player_type *creature_ptr);
 extern void print_rel(player_type *subject_ptr, SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x);
 extern void note_spot(player_type *player_ptr, POSITION y, POSITION x);
-extern void lite_spot(POSITION y, POSITION x);
+extern void lite_spot(player_type *player_ptr, POSITION y, POSITION x);
 extern void update_flow(player_type *subject_ptr);
 extern FEAT_IDX feat_state(FEAT_IDX feat, int action);
 extern void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, int action);
index 4eab76e..92f1720 100644 (file)
@@ -1684,8 +1684,8 @@ static bool cast_ninja_spell(player_type *caster_ptr, int spell)
                (void)set_monster_csleep(caster_ptr, m_idx, 0);
 
                update_monster(caster_ptr, m_idx, TRUE);
-               lite_spot(target_row, target_col);
-               lite_spot(ty, tx);
+               lite_spot(caster_ptr, target_row, target_col);
+               lite_spot(caster_ptr, ty, tx);
 
                if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
                        caster_ptr->update |= (PU_MON_LITE);
index 6a782a5..e968a6a 100644 (file)
@@ -1960,7 +1960,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                                g_ptr->mimic = 0;
 
                                note_spot(target_ptr, ny, nx);
-                               lite_spot(ny, nx);
+                               lite_spot(target_ptr, ny, nx);
 
                                if (!monster_is_valid(m_ptr)) return;
                                /* Allow movement */
@@ -2175,8 +2175,8 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                        m_ptr->fx = nx;
                        update_monster(target_ptr, m_idx, TRUE);
 
-                       lite_spot(oy, ox);
-                       lite_spot(ny, nx);
+                       lite_spot(target_ptr, oy, ox);
+                       lite_spot(target_ptr, ny, nx);
                }
                else
                {
@@ -2319,7 +2319,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                                        msg_format(_("%^sが%sを破壊した。", "%^s destroys %s."), m_name, o_name);
                                }
 
-                               delete_object_idx(target_ptr->current_floor_ptr, this_o_idx);
+                               delete_object_idx(target_ptr, this_o_idx);
                        }
                }
 
index d27d249..b8185b6 100644 (file)
@@ -1012,7 +1012,7 @@ void monster_gain_exp(player_type *target_ptr, MONSTER_IDX m_idx, MONRACE_IDX s_
        }
 
        update_monster(target_ptr, m_idx, FALSE);
-       lite_spot(m_ptr->fy, m_ptr->fx);
+       lite_spot(target_ptr, m_ptr->fy, m_ptr->fx);
 
        if (m_idx == target_ptr->riding) target_ptr->update |= PU_BONUS;
 }
index 014eb52..71b9045 100644 (file)
@@ -153,12 +153,12 @@ void delete_monster_idx(player_type *player_ptr, MONSTER_IDX i)
                object_type *o_ptr;
                o_ptr = &floor_ptr->o_list[this_o_idx];
                next_o_idx = o_ptr->next_o_idx;
-               delete_object_idx(floor_ptr, this_o_idx);
+               delete_object_idx(player_ptr, this_o_idx);
        }
 
        (void)WIPE(m_ptr, monster_type);
        floor_ptr->m_cnt--;
-       lite_spot(y, x);
+       lite_spot(player_ptr, y, x);
        if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
        {
                player_ptr->update |= (PU_MON_LITE);
@@ -2055,7 +2055,7 @@ void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full)
                        m_ptr->ml = TRUE;
 
                        /* Draw the monster */
-                       lite_spot(fy, fx);
+                       lite_spot(subject_ptr, fy, fx);
 
                        /* Update health bar as needed */
                        if (subject_ptr->health_who == m_idx) subject_ptr->redraw |= (PR_HEALTH);
@@ -2094,7 +2094,7 @@ void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full)
                        m_ptr->ml = FALSE;
 
                        /* Erase the monster */
-                       lite_spot(fy, fx);
+                       lite_spot(subject_ptr, fy, fx);
 
                        /* Update health bar as needed */
                        if (subject_ptr->health_who == m_idx) subject_ptr->redraw |= (PR_HEALTH);
@@ -2300,7 +2300,7 @@ void choose_new_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool born, M
        m_ptr->r_idx = r_idx;
        m_ptr->ap_r_idx = r_idx;
        update_monster(player_ptr, m_idx, FALSE);
-       lite_spot(m_ptr->fy, m_ptr->fx);
+       lite_spot(player_ptr, m_ptr->fy, m_ptr->fx);
 
        int old_r_idx = m_ptr->r_idx;
        if ((r_info[old_r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) ||
@@ -2820,7 +2820,7 @@ static bool place_monster_one(player_type *player_ptr, MONSTER_IDX who, POSITION
        g_ptr->mimic = 0;
 
        note_spot(player_ptr, y, x);
-       lite_spot(y, x);
+       lite_spot(player_ptr, y, x);
 
        return TRUE;
 }
@@ -4019,7 +4019,7 @@ void monster_drop_carried_objects(player_type *player_ptr, monster_type *m_ptr)
 
                object_copy(q_ptr, o_ptr);
                q_ptr->held_m_idx = 0;
-               delete_object_idx(floor_ptr, this_o_idx);
+               delete_object_idx(player_ptr, this_o_idx);
                (void)drop_near(player_ptr, q_ptr, -1, m_ptr->fy, m_ptr->fx);
        }
 
index 80ec4f4..fd3429b 100644 (file)
@@ -427,8 +427,8 @@ extern int bow_tval_ammo(object_type *o_ptr);
 
 /* object2.c */
 extern void excise_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx);
-extern void delete_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx);
-extern void delete_object(floor_type *floor_ptr, POSITION y, POSITION x);
+extern void delete_object_idx(player_type *owner_ptr, OBJECT_IDX o_idx);
+extern void delete_object(player_type *owner_ptr, POSITION y, POSITION x);
 
 extern OBJECT_IDX o_pop(floor_type *floor_ptr);
 extern OBJECT_IDX get_obj_num(player_type *o_ptr, DEPTH level, BIT_FLAGS mode);
@@ -489,7 +489,7 @@ extern void inven_item_increase(player_type *owner_ptr, INVENTORY_IDX item, ITEM
 extern void inven_item_optimize(player_type *owner_ptr, INVENTORY_IDX item);
 extern void floor_item_charges(floor_type *owner_ptr, INVENTORY_IDX item);
 extern void floor_item_increase(floor_type *floor_ptr, INVENTORY_IDX item, ITEM_NUMBER num);
-extern void floor_item_optimize(floor_type *floor_ptr, INVENTORY_IDX item);
+extern void floor_item_optimize(player_type *owner_ptr, INVENTORY_IDX item);
 extern bool inven_carry_okay(object_type *o_ptr);
 extern bool object_sort_comp(object_type *o_ptr, s32b o_value, object_type *j_ptr);
 extern s16b inven_carry(player_type *owner_ptr, object_type *o_ptr);
index 8e743a6..6db52b2 100644 (file)
@@ -195,17 +195,18 @@ void excise_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx)
 /*!
  * @brief オブジェクトを削除する /
  * Delete a dungeon object
- * @param floo_ptr 現在フロアへの参照ポインタ
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param o_idx 削除対象のオブジェクト構造体ポインタ
  * @return なし
  * @details
  * Handle "stacks" of objects correctly.
  */
-void delete_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx)
+void delete_object_idx(player_type *player_ptr, OBJECT_IDX o_idx)
 {
        object_type *j_ptr;
 
        /* Excise */
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        excise_object_idx(floor_ptr, o_idx);
 
        /* Object */
@@ -217,7 +218,7 @@ void delete_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx)
                POSITION y, x;
                y = j_ptr->iy;
                x = j_ptr->ix;
-               lite_spot(y, x);
+               lite_spot(player_ptr, y, x);
        }
 
        object_wipe(j_ptr);
@@ -228,17 +229,18 @@ void delete_object_idx(floor_type *floor_ptr, OBJECT_IDX o_idx)
 /*!
  * @brief フロアにマスに落ちているオブジェクトを全て削除する / Deletes all objects at given location
  * Delete a dungeon object
- * @param floo_ptr 現在フロアへの参照ポインタ
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param y 削除したフロアマスのY座標
  * @param x 削除したフロアマスのX座標
  * @return なし
  */
-void delete_object(floor_type *floor_ptr, POSITION y, POSITION x)
+void delete_object(player_type *player_ptr, POSITION y, POSITION x)
 {
        grid_type *g_ptr;
        OBJECT_IDX this_o_idx, next_o_idx = 0;
 
        /* Refuse "illegal" locations */
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        if (!in_bounds(floor_ptr, y, x)) return;
 
        g_ptr = &floor_ptr->grid_array[y][x];
@@ -254,7 +256,7 @@ void delete_object(floor_type *floor_ptr, POSITION y, POSITION x)
        }
 
        g_ptr->o_idx = 0;
-       lite_spot(y, x);
+       lite_spot(player_ptr, y, x);
 }
 
 
@@ -4470,7 +4472,7 @@ OBJECT_IDX drop_near(player_type *owner_ptr, object_type *j_ptr, PERCENTAGE chan
        }
 
        note_spot(owner_ptr, by, bx);
-       lite_spot(by, bx);
+       lite_spot(owner_ptr, by, bx);
        sound(SOUND_DROP);
 
        /* Mega-Hack -- no message if "dropped" by player */
@@ -4572,7 +4574,7 @@ void vary_item(player_type *owner_ptr, INVENTORY_IDX item, ITEM_NUMBER num)
        floor_type *floor_ptr = owner_ptr->current_floor_ptr;
        floor_item_increase(floor_ptr, 0 - item, num);
        floor_item_describe(floor_ptr, 0 - item);
-       floor_item_optimize(floor_ptr, 0 - item);
+       floor_item_optimize(owner_ptr, 0 - item);
 }
 
 
@@ -4772,13 +4774,13 @@ void floor_item_increase(floor_type *floor_ptr, INVENTORY_IDX item, ITEM_NUMBER
 /*!
  * @brief 床上の数の無くなったアイテムスロットを消去する /
  * Optimize an item on the floor (destroy "empty" items)
- * @param floo_ptr 現在フロアへの参照ポインタ
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param item 消去したいアイテムの所持スロット
  * @return なし
  */
-void floor_item_optimize(floor_type *floor_ptr, INVENTORY_IDX item)
+void floor_item_optimize(player_type *owner_ptr, INVENTORY_IDX item)
 {
-       object_type *o_ptr = &floor_ptr->o_list[item];
+       object_type *o_ptr = &owner_ptr->current_floor_ptr->o_list[item];
 
        /* Paranoia -- be sure it exists */
        if (!o_ptr->k_idx) return;
@@ -4786,7 +4788,7 @@ void floor_item_optimize(floor_type *floor_ptr, INVENTORY_IDX item)
        /* Only optimize empty items */
        if (o_ptr->number) return;
 
-       delete_object_idx(floor_ptr, item);
+       delete_object_idx(owner_ptr, item);
 }
 
 
index cc939f5..f39792e 100644 (file)
@@ -3674,7 +3674,7 @@ void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effe
        if (old_race != creature_ptr->prace) autopick_load_pref(creature_ptr, FALSE);
 
        /* Player's graphic tile may change */
-       lite_spot(creature_ptr->y, creature_ptr->x);
+       lite_spot(creature_ptr, creature_ptr->y, creature_ptr->x);
 }
 
 
index c1441a8..7174b02 100644 (file)
@@ -2900,7 +2900,7 @@ void py_pickup_floor(player_type *owner_ptr, bool pickup)
                        owner_ptr->window |= (PW_PLAYER);
 
                        /* Delete the gold */
-                       delete_object_idx(owner_ptr->current_floor_ptr, this_o_idx);
+                       delete_object_idx(owner_ptr, this_o_idx);
 
                        /* Check the next object */
                        continue;
index 691a3b2..8e87b88 100644 (file)
@@ -293,7 +293,7 @@ void py_pickup_aux(player_type *owner_ptr, OBJECT_IDX o_idx)
        /* Get the object again */
        o_ptr = &owner_ptr->inventory_list[slot];
 
-       delete_object_idx(owner_ptr->current_floor_ptr, o_idx);
+       delete_object_idx(owner_ptr, o_idx);
 
        if (owner_ptr->pseikaku == SEIKAKU_MUNCHKIN)
        {
@@ -399,7 +399,7 @@ void carry(player_type *creature_ptr, bool pickup)
                if (o_ptr->tval == TV_GOLD)
                {
                        int value = (long)o_ptr->pval;
-                       delete_object_idx(creature_ptr->current_floor_ptr, this_o_idx);
+                       delete_object_idx(creature_ptr, this_o_idx);
                        msg_format(_(" $%ld の価値がある%sを見つけた。", "You collect %ld gold pieces worth of %s."),
                           (long)value, o_name);
 
@@ -620,8 +620,8 @@ bool move_player_effect(player_type *creature_ptr, POSITION ny, POSITION nx, BIT
                        }
                }
 
-               lite_spot(oy, ox);
-               lite_spot(ny, nx);
+               lite_spot(creature_ptr, oy, ox);
+               lite_spot(creature_ptr, ny, nx);
 
                /* Check for new panel (redraw map) */
                verify_panel(creature_ptr);
@@ -1158,7 +1158,7 @@ void move_player(player_type *creature_ptr, DIRECTION dir, bool do_pickup, bool
 #endif
 
                                g_ptr->info |= (CAVE_MARK);
-                               lite_spot(y, x);
+                               lite_spot(creature_ptr, y, x);
                        }
                }
 
index 97289e8..b6989f9 100644 (file)
@@ -329,8 +329,8 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                                        m_ptr->fx = tx;
 
                                        update_monster(caster_ptr, m_idx, TRUE);
-                                       lite_spot(oy, ox);
-                                       lite_spot(ty, tx);
+                                       lite_spot(caster_ptr, oy, ox);
+                                       lite_spot(caster_ptr, ty, tx);
 
                                        if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
                                                caster_ptr->update |= (PU_MON_LITE);
@@ -693,10 +693,10 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                                update_monster(caster_ptr, m_idx, TRUE);
 
                                /* Redraw the old spot */
-                               lite_spot(y, x);
+                               lite_spot(caster_ptr, y, x);
 
                                /* Redraw the new spot */
-                               lite_spot(ny, nx);
+                               lite_spot(caster_ptr, ny, nx);
 
                                /* Player can move forward? */
                                if (player_can_enter(caster_ptr, g_ptr->feat, 0))
index e70797d..397dcec 100644 (file)
@@ -193,7 +193,7 @@ bool warding_glyph(player_type *caster_ptr)
        caster_ptr->current_floor_ptr->grid_array[caster_ptr->y][caster_ptr->x].mimic = feat_glyph;
 
        note_spot(caster_ptr, caster_ptr->y, caster_ptr->x);
-       lite_spot(caster_ptr->y, caster_ptr->x);
+       lite_spot(caster_ptr, caster_ptr->y, caster_ptr->x);
 
        return TRUE;
 }
@@ -221,7 +221,7 @@ bool explosive_rune(player_type *caster_ptr, POSITION y, POSITION x)
        floor_ptr->grid_array[y][x].mimic = feat_explosive_rune;
 
        note_spot(caster_ptr, y, x);
-       lite_spot(y, x);
+       lite_spot(caster_ptr, y, x);
 
        return TRUE;
 }
@@ -247,7 +247,7 @@ bool place_mirror(player_type *caster_ptr)
        caster_ptr->current_floor_ptr->grid_array[caster_ptr->y][caster_ptr->x].info |= CAVE_GLOW;
 
        note_spot(caster_ptr, caster_ptr->y, caster_ptr->x);
-       lite_spot(caster_ptr->y, caster_ptr->x);
+       lite_spot(caster_ptr, caster_ptr->y, caster_ptr->x);
        update_local_illumination(caster_ptr, caster_ptr->y, caster_ptr->x);
 
        return TRUE;
@@ -288,7 +288,7 @@ void stair_creation(player_type *caster_ptr)
        }
 
        /* Destroy all objects in the grid */
-       delete_object(floor_ptr, caster_ptr->y, caster_ptr->x);
+       delete_object(caster_ptr, caster_ptr->y, caster_ptr->x);
 
        /* Extract current floor data */
        saved_floor_type *sf_ptr;
@@ -568,7 +568,7 @@ bool destroy_area(player_type *caster_ptr, POSITION y1, POSITION x1, POSITION r,
                                }
                        }
 
-                       delete_object(floor_ptr, y, x);
+                       delete_object(caster_ptr, y, x);
 
                        /* Destroy "non-permanent" grids */
                        if (cave_perma_grid(g_ptr)) continue;
@@ -1027,8 +1027,8 @@ bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, M
                        m_ptr->fx = sx;
 
                        update_monster(caster_ptr, m_idx, TRUE);
-                       lite_spot(yy, xx);
-                       lite_spot(sy, sx);
+                       lite_spot(caster_ptr, yy, xx);
+                       lite_spot(caster_ptr, sy, sx);
                }
        }
 
@@ -1052,7 +1052,7 @@ bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, M
                        /* Destroy location (if valid) */
                        if (!cave_valid_bold(floor_ptr, yy, xx)) continue;
 
-                       delete_object(floor_ptr, yy, xx);
+                       delete_object(caster_ptr, yy, xx);
 
                        /* Wall (or floor) type */
                        int t = cave_have_flag_bold(floor_ptr, yy, xx, FF_PROJECT) ? randint0(100) : 200;
index 6a5d707..ab484e5 100644 (file)
@@ -416,7 +416,7 @@ static bool project_f(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                if (!caster_ptr->blind && player_has_los_bold(caster_ptr, y, x))
                {
                        g_ptr->info &= ~(CAVE_UNSAFE);
-                       lite_spot(y, x);
+                       lite_spot(caster_ptr, y, x);
                        obvious = TRUE;
                }
 
@@ -444,7 +444,7 @@ static bool project_f(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                if (!caster_ptr->blind && player_has_los_bold(caster_ptr, y, x))
                {
                        g_ptr->info &= ~(CAVE_UNSAFE);
-                       lite_spot(y, x);
+                       lite_spot(caster_ptr, y, x);
                        obvious = TRUE;
                }
 
@@ -462,7 +462,7 @@ static bool project_f(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                        g_ptr->mimic = old_mimic;
 
                        note_spot(caster_ptr, y, x);
-                       lite_spot(y, x);
+                       lite_spot(caster_ptr, y, x);
 
                        /* Check line of sight */
                        if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
@@ -524,7 +524,7 @@ static bool project_f(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                g_ptr->info |= CAVE_OBJECT;
                g_ptr->mimic = feat_glyph;
                note_spot(caster_ptr, y, x);
-               lite_spot(y, x);
+               lite_spot(caster_ptr, y, x);
                break;
        }
 
@@ -577,7 +577,7 @@ static bool project_f(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                {
                        g_ptr->info |= (CAVE_GLOW);
                        note_spot(caster_ptr, y, x);
-                       lite_spot(y, x);
+                       lite_spot(caster_ptr, y, x);
                        update_local_illumination(caster_ptr, y, x);
 
                        /* Observe */
@@ -639,7 +639,7 @@ static bool project_f(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                                note_spot(caster_ptr, y, x);
                        }
 
-                       lite_spot(y, x);
+                       lite_spot(caster_ptr, y, x);
 
                        update_local_illumination(caster_ptr, y, x);
 
@@ -727,7 +727,7 @@ static bool project_f(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
        }
        }
 
-       lite_spot(y, x);
+       lite_spot(caster_ptr, y, x);
        /* Return "Anything seen?" */
        return (obvious);
 }
@@ -1054,7 +1054,7 @@ static bool project_o(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
 
                                k_idx = o_ptr->k_idx;
                                is_potion = object_is_potion(o_ptr);
-                               delete_object_idx(caster_ptr->current_floor_ptr, this_o_idx);
+                               delete_object_idx(caster_ptr, this_o_idx);
 
                                /* Potions produce effects when 'shattered' */
                                if (is_potion)
@@ -1062,7 +1062,7 @@ static bool project_o(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                                        (void)potion_smash_effect(caster_ptr, who, y, x, k_idx);
                                }
 
-                               lite_spot(y, x);
+                               lite_spot(caster_ptr, y, x);
                        }
                }
        }
@@ -3918,7 +3918,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
        if (m_ptr->r_idx) update_monster(caster_ptr, g_ptr->m_idx, FALSE);
 
        /* Redraw the monster grid */
-       lite_spot(y, x);
+       lite_spot(caster_ptr, y, x);
 
        /* Update monster recall window */
        if ((caster_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
@@ -5763,7 +5763,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                                        move_cursor_relative(y, x);
                                        Term_fresh();
                                        Term_xtra(TERM_XTRA_DELAY, msec);
-                                       lite_spot(y, x);
+                                       lite_spot(caster_ptr, y, x);
                                        Term_fresh();
 
                                        /* Display "beam" grids */
@@ -5902,7 +5902,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                                        move_cursor_relative(y, x);
                                        /*if (fresh_before)*/ Term_fresh();
                                        Term_xtra(TERM_XTRA_DELAY, msec);
-                                       lite_spot(y, x);
+                                       lite_spot(caster_ptr, y, x);
                                        /*if (fresh_before)*/ Term_fresh();
 
                                        /* Display "beam" grids */
@@ -6048,7 +6048,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                                move_cursor_relative(y, x);
                                /*if (fresh_before)*/ Term_fresh();
                                Term_xtra(TERM_XTRA_DELAY, msec);
-                               lite_spot(y, x);
+                               lite_spot(caster_ptr, y, x);
                                /*if (fresh_before)*/ Term_fresh();
 
                                /* Display "beam" grids */
@@ -6236,7 +6236,7 @@ bool project(player_type *caster_ptr, MONSTER_IDX who, POSITION rad, POSITION y,
                                /* Hack -- Erase if needed */
                                if (panel_contains(y, x) && player_has_los_bold(caster_ptr, y, x))
                                {
-                                       lite_spot(y, x);
+                                       lite_spot(caster_ptr, y, x);
                                }
                        }
 
index b958652..6c0c393 100644 (file)
@@ -91,7 +91,7 @@ static bool detect_feat_flag(player_type *caster_ptr, POSITION range, int flag,
 
                                        g_ptr->info &= ~(CAVE_UNSAFE);
 
-                                       lite_spot(y, x);
+                                       lite_spot(caster_ptr, y, x);
                                }
                        }
 
@@ -99,7 +99,7 @@ static bool detect_feat_flag(player_type *caster_ptr, POSITION range, int flag,
                        {
                                disclose_grid(caster_ptr, y, x);
                                g_ptr->info |= (CAVE_MARK);
-                               lite_spot(y, x);
+                               lite_spot(caster_ptr, y, x);
                                detect = TRUE;
                        }
                }
@@ -223,7 +223,7 @@ bool detect_objects_gold(player_type *caster_ptr, POSITION range)
                if (o_ptr->tval == TV_GOLD)
                {
                        o_ptr->marked |= OM_FOUND;
-                       lite_spot(y, x);
+                       lite_spot(caster_ptr, y, x);
                        detect = TRUE;
                }
        }
@@ -274,7 +274,7 @@ bool detect_objects_normal(player_type *caster_ptr, POSITION range)
                if (o_ptr->tval != TV_GOLD)
                {
                        o_ptr->marked |= OM_FOUND;
-                       lite_spot(y, x);
+                       lite_spot(caster_ptr, y, x);
                        detect = TRUE;
                }
        }
@@ -360,7 +360,7 @@ bool detect_objects_magic(player_type *caster_ptr, POSITION range)
                {
                        /* Memorize the item */
                        o_ptr->marked |= OM_FOUND;
-                       lite_spot(y, x);
+                       lite_spot(caster_ptr, y, x);
                        detect = TRUE;
                }
        }
@@ -1311,7 +1311,7 @@ bool probing(player_type *caster_ptr)
                                m_ptr->mflag2 &= ~(MFLAG2_KAGE);
 
                        m_ptr->ap_r_idx = m_ptr->r_idx;
-                       lite_spot(m_ptr->fy, m_ptr->fx);
+                       lite_spot(caster_ptr, m_ptr->fy, m_ptr->fx);
                }
 
                /* Get "the monster" or "something" */
@@ -1515,7 +1515,7 @@ static void cave_temp_room_lite(player_type *caster_ptr)
                }
 
                note_spot(caster_ptr, y, x);
-               lite_spot(y, x);
+               lite_spot(caster_ptr, y, x);
                update_local_illumination(caster_ptr, y, x);
        }
 
@@ -1592,7 +1592,7 @@ static void cave_temp_room_unlite(player_type *caster_ptr)
                        update_monster(caster_ptr, g_ptr->m_idx, FALSE);
                }
 
-               lite_spot(y, x);
+               lite_spot(caster_ptr, y, x);
                update_local_illumination(caster_ptr, y, x);
        }
 
index 041edb8..3f09435 100644 (file)
@@ -150,8 +150,8 @@ bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, BIT
        reset_target(m_ptr);
 
        update_monster(caster_ptr, m_idx, TRUE);
-       lite_spot(oy, ox);
-       lite_spot(ny, nx);
+       lite_spot(caster_ptr, oy, ox);
+       lite_spot(caster_ptr, ny, nx);
 
        if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
                caster_ptr->update |= (PU_MON_LITE);
@@ -236,8 +236,8 @@ void teleport_monster_to(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION ty
        m_ptr->fx = nx;
 
        update_monster(caster_ptr, m_idx, TRUE);
-       lite_spot(oy, ox);
-       lite_spot(ny, nx);
+       lite_spot(caster_ptr, oy, ox);
+       lite_spot(caster_ptr, ny, nx);
 
        if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
                caster_ptr->update |= (PU_MON_LITE);
@@ -2800,7 +2800,7 @@ bool polymorph_monster(player_type *caster_ptr, POSITION y, POSITION x)
                for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
                {
                        next_o_idx = floor_ptr->o_list[this_o_idx].next_o_idx;
-                       delete_object_idx(floor_ptr, this_o_idx);
+                       delete_object_idx(caster_ptr, this_o_idx);
                }
        }
 
@@ -3234,8 +3234,8 @@ bool shock_power(player_type *caster_ptr)
        m_ptr->fx = tx;
 
        update_monster(caster_ptr, m_idx, TRUE);
-       lite_spot(oy, ox);
-       lite_spot(ty, tx);
+       lite_spot(caster_ptr, oy, ox);
+       lite_spot(caster_ptr, ty, tx);
 
        if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
                caster_ptr->update |= (PU_MON_LITE);
index 72f4243..a01d3d6 100644 (file)
@@ -194,7 +194,7 @@ void disclose_grid(player_type *trapped_ptr, POSITION y, POSITION x)
                g_ptr->mimic = 0;
 
                note_spot(trapped_ptr, y, x);
-               lite_spot(y, x);
+               lite_spot(trapped_ptr, y, x);
        }
 }
 
index 0ba35c0..4dcac6a 100644 (file)
@@ -2554,7 +2554,7 @@ void print_map(player_type *player_ptr)
        }
 
        /* Display player */
-       lite_spot(player_ptr->y, player_ptr->x);
+       lite_spot(player_ptr, player_ptr->y, player_ptr->x);
 
        /* Restore the cursor */
        (void)Term_set_cursor(v);
@@ -3861,7 +3861,7 @@ void delayed_visual_update(player_type *player_ptr)
                /* If required, note */
                if (g_ptr->info & CAVE_NOTE) note_spot(player_ptr, y, x);
 
-               lite_spot(y, x);
+               lite_spot(player_ptr, y, x);
 
                /* Hack -- Visual update of monster on this grid */
                if (g_ptr->m_idx) update_monster(player_ptr, g_ptr->m_idx, FALSE);
index ede3af7..7a339c9 100644 (file)
@@ -1626,7 +1626,7 @@ static void do_cmd_wiz_create_feature(player_type *creature_ptr)
                g_ptr->info |= (CAVE_GLOW | CAVE_OBJECT);
 
        note_spot(creature_ptr, y, x);
-       lite_spot(y, x);
+       lite_spot(creature_ptr, y, x);
        creature_ptr->update |= (PU_FLOW);
 
        prev_feat = tmp_feat;