OSDN Git Service

[Refactor] #38997 object_desc() と screen_object()にplayer_type * 引数を追加 / Added player_...
[hengband/hengband.git] / src / cmd / cmd-item.c
index 6dbcfd5..306c96b 100644 (file)
@@ -60,17 +60,16 @@ void do_cmd_inven(player_type *creature_ptr)
        command_wrk = FALSE;
        if (easy_floor) command_wrk = (USE_INVEN);
        screen_save();
-       (void)show_inven(0, USE_FULL, 0);
+       (void)show_inventory(creature_ptr, 0, USE_FULL, 0);
 
 #ifdef JP
        sprintf(out_val, "持ち物: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
                (int)lbtokg1(creature_ptr->total_weight) , (int)lbtokg2(creature_ptr->total_weight) ,
-               (long int)((creature_ptr->total_weight * 100) / weight_limit(creature_ptr)));
 #else
        sprintf(out_val, "Inventory: carrying %d.%d pounds (%ld%% of capacity). Command: ",
                (int)(creature_ptr->total_weight / 10), (int)(creature_ptr->total_weight % 10),
-               (creature_ptr->total_weight * 100) / weight_limit(creature_ptr));
 #endif
+               (long int)(creature_ptr->total_weight * 100) / weight_limit(creature_ptr));
 
        prt(out_val, 0, 0);
        command_new = inkey();
@@ -101,7 +100,7 @@ void do_cmd_equip(player_type *creature_ptr)
        if (easy_floor) command_wrk = (USE_EQUIP);
        screen_save();
 
-       (void)show_equip(0, USE_FULL, 0);
+       (void)show_equipment(creature_ptr, 0, USE_FULL, 0);
 
 #ifdef JP
        sprintf(out_val, "装備: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
@@ -135,6 +134,7 @@ bool select_ring_slot = FALSE;
 
 /*!
  * @brief 装備するコマンドのメインルーチン / Wield or wear a single item from the pack or floor
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし 
  */
 void do_cmd_wield(player_type *creature_ptr)
@@ -167,7 +167,7 @@ void do_cmd_wield(player_type *creature_ptr)
        if (!o_ptr) return;
 
        /* Check the slot */
-       slot = wield_slot(o_ptr);
+       slot = wield_slot(creature_ptr, o_ptr);
 
        switch (o_ptr->tval)
        {
@@ -264,11 +264,11 @@ void do_cmd_wield(player_type *creature_ptr)
        /* Prevent wielding into a cursed slot */
        if (object_is_cursed(&creature_ptr->inventory_list[slot]))
        {
-               object_desc(o_name, &creature_ptr->inventory_list[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
+               object_desc(creature_ptr, o_name, &creature_ptr->inventory_list[slot], (OD_OMIT_PREFIX | OD_NAME_ONLY));
 #ifdef JP
-               msg_format("%s%sは呪われているようだ。", describe_use(slot) , o_name );
+               msg_format("%s%sは呪われているようだ。", describe_use(creature_ptr, slot), o_name);
 #else
-               msg_format("The %s you are %s appears to be cursed.", o_name, describe_use(slot));
+               msg_format("The %s you are %s appears to be cursed.", o_name, describe_use(creature_ptr, slot));
 #endif
                return;
        }
@@ -280,7 +280,7 @@ void do_cmd_wield(player_type *creature_ptr)
        {
                char dummy[MAX_NLEN+80];
 
-               object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+               object_desc(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
                sprintf(dummy, _("本当に%s{呪われている}を使いますか?", "Really use the %s {cursed}? "), o_name);
 
                if (!get_check(dummy)) return;
@@ -290,7 +290,7 @@ void do_cmd_wield(player_type *creature_ptr)
        {
                char dummy[MAX_NLEN+100];
 
-               object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+               object_desc(creature_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
                sprintf(dummy, _("%sを装備すると吸血鬼になります。よろしいですか?",
                        "%s will transforms you into a vampire permanently when equiped. Do you become a vampire?"), o_name);
@@ -306,7 +306,7 @@ void do_cmd_wield(player_type *creature_ptr)
                object_type *otmp_ptr = &object_tmp;
                GAME_TEXT switch_name[MAX_NLEN];
 
-               object_desc(switch_name, switch_o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+               object_desc(creature_ptr, switch_name, switch_o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
                object_copy(otmp_ptr, switch_o_ptr);
                object_copy(switch_o_ptr, slot_o_ptr);
@@ -318,14 +318,14 @@ void do_cmd_wield(player_type *creature_ptr)
                slot = need_switch_wielding;
        }
 
-       check_find_art_quest_completion(o_ptr);
+       check_find_art_quest_completion(creature_ptr, o_ptr);
 
        if (creature_ptr->pseikaku == SEIKAKU_MUNCHKIN)
        {
-               identify_item(o_ptr);
+               identify_item(creature_ptr, o_ptr);
 
                /* Auto-inscription */
-               autopick_alter_item(item, FALSE);
+               autopick_alter_item(creature_ptr, item, FALSE);
        }
 
        take_turn(creature_ptr, 100);
@@ -340,15 +340,14 @@ void do_cmd_wield(player_type *creature_ptr)
        /* Decrease the item (from the pack) */
        if (item >= 0)
        {
-               inven_item_increase(item, -1);
-               inven_item_optimize(item);
+               inven_item_increase(creature_ptr, item, -1);
+               inven_item_optimize(creature_ptr, item);
        }
-
        /* Decrease the item (from the floor) */
        else
        {
-               floor_item_increase(0 - item, -1);
-               floor_item_optimize(0 - item);
+               floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
+               floor_item_optimize(creature_ptr, 0 - item);
        }
 
        /* Access the wield slot */
@@ -358,7 +357,7 @@ void do_cmd_wield(player_type *creature_ptr)
        if (o_ptr->k_idx)
        {
                /* Take off existing item */
-               (void)inven_takeoff(slot, 255);
+               (void)inven_takeoff(creature_ptr, slot, 255);
        }
 
        /* Wear the new stuff */
@@ -379,14 +378,14 @@ void do_cmd_wield(player_type *creature_ptr)
        switch (slot)
        {
        case INVEN_RARM:
-               if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM) && CAN_TWO_HANDS_WIELDING())
+               if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_LARM) && can_two_hands_wielding(creature_ptr))
                        act = STR_WIELD_ARMS;
                else
                        act = (left_hander ? STR_WIELD_LARM : STR_WIELD_RARM);
                break;
 
        case INVEN_LARM:
-               if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM) && CAN_TWO_HANDS_WIELDING())
+               if (object_allow_two_hands_wielding(o_ptr) && (empty_hands(creature_ptr, FALSE) == EMPTY_HAND_RARM) && can_two_hands_wielding(creature_ptr))
                        act = STR_WIELD_ARMS;
                else
                        act = (left_hander ? STR_WIELD_RARM : STR_WIELD_LARM);
@@ -405,7 +404,7 @@ void do_cmd_wield(player_type *creature_ptr)
                break;
        }
 
-       object_desc(o_name, o_ptr, 0);
+       object_desc(creature_ptr, o_name, o_ptr, 0);
        msg_format(act, o_name, index_to_label(slot));
 
        /* Cursed! */
@@ -418,7 +417,7 @@ void do_cmd_wield(player_type *creature_ptr)
                o_ptr->ident |= (IDENT_SENSE);
        }
 
-       /* The Stone Mask make the player current_world_ptr->game_turn into a vampire! */
+       /* The Stone Mask make the player turn into a vampire! */
        if ((o_ptr->name1 == ART_STONEMASK) && (creature_ptr->prace != RACE_VAMPIRE) && (creature_ptr->prace != RACE_ANDROID))
        {
                /* Turn into a vampire */
@@ -432,8 +431,10 @@ void do_cmd_wield(player_type *creature_ptr)
        calc_android_exp(creature_ptr);
 }
 
+
 /*!
  * @brief 持ち替え処理
+ * @param owner_ptr プレーヤーへの参照ポインタ
  * @param item 持ち替えを行いたい装備部位ID
  * @return なし
  */
@@ -444,51 +445,51 @@ void verify_equip_slot(player_type *owner_ptr, INVENTORY_IDX item)
 
        if (item == INVEN_RARM)
        {
-               if (has_melee_weapon(owner_ptr, INVEN_LARM))
-               {
-                       o_ptr = &owner_ptr->inventory_list[INVEN_LARM];
-                       object_desc(o_name, o_ptr, 0);
+               if (!has_melee_weapon(owner_ptr, INVEN_LARM)) return;
 
-                       if (!object_is_cursed(o_ptr))
-                       {
-                               new_o_ptr = &owner_ptr->inventory_list[INVEN_RARM];
-                               object_copy(new_o_ptr, o_ptr);
-                               owner_ptr->total_weight += o_ptr->weight;
-                               inven_item_increase(INVEN_LARM, -((int)o_ptr->number));
-                               inven_item_optimize(INVEN_LARM);
-                               if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
-                                       msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
-                               else
-                                       msg_format(_("%sを%sで構えた。", "You are wielding %s in your %s hand."), o_name, 
-                                               (left_hander ? _("左手", "left") : _("右手", "right")));
-                       }
-                       else
-                       {
-                               if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
-                                       msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
-                       }
-               }
-       }
-       else if (item == INVEN_LARM)
-       {
-               o_ptr = &owner_ptr->inventory_list[INVEN_RARM];
-               if (o_ptr->k_idx) object_desc(o_name, o_ptr, 0);
+               o_ptr = &owner_ptr->inventory_list[INVEN_LARM];
+               object_desc(owner_ptr, o_name, o_ptr, 0);
 
-               if (has_melee_weapon(owner_ptr, INVEN_RARM))
+               if (object_is_cursed(o_ptr))
                {
-                       if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
+                       if (object_allow_two_hands_wielding(o_ptr) && can_two_hands_wielding(owner_ptr))
                                msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
+                       return;
                }
-               else if (!(empty_hands(owner_ptr, FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
-               {
-                       new_o_ptr = &owner_ptr->inventory_list[INVEN_LARM];
-                       object_copy(new_o_ptr, o_ptr);
-                       owner_ptr->total_weight += o_ptr->weight;
-                       inven_item_increase(INVEN_RARM, -((int)o_ptr->number));
-                       inven_item_optimize(INVEN_RARM);
-                       msg_format(_("%sを持ち替えた。", "You switched hand of %s."), o_name);
-               }
+
+               new_o_ptr = &owner_ptr->inventory_list[INVEN_RARM];
+               object_copy(new_o_ptr, o_ptr);
+               owner_ptr->total_weight += o_ptr->weight;
+               inven_item_increase(owner_ptr, INVEN_LARM, -((int)o_ptr->number));
+               inven_item_optimize(owner_ptr, INVEN_LARM);
+               if (object_allow_two_hands_wielding(o_ptr) && can_two_hands_wielding(owner_ptr))
+                       msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
+               else
+                       msg_format(_("%sを%sで構えた。", "You are wielding %s in your %s hand."), o_name,
+                       (left_hander ? _("左手", "left") : _("右手", "right")));
+               return;
        }
+       
+       if (item != INVEN_LARM) return;
+
+       o_ptr = &owner_ptr->inventory_list[INVEN_RARM];
+       if (o_ptr->k_idx) object_desc(owner_ptr, o_name, o_ptr, 0);
+
+       if (has_melee_weapon(owner_ptr, INVEN_RARM))
+       {
+               if (object_allow_two_hands_wielding(o_ptr) && can_two_hands_wielding(owner_ptr))
+                       msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
+               return;
+       }
+       
+       if ((empty_hands(owner_ptr, FALSE) & EMPTY_HAND_RARM) || object_is_cursed(o_ptr)) return;
+
+       new_o_ptr = &owner_ptr->inventory_list[INVEN_LARM];
+       object_copy(new_o_ptr, o_ptr);
+       owner_ptr->total_weight += o_ptr->weight;
+       inven_item_increase(owner_ptr, INVEN_RARM, -((int)o_ptr->number));
+       inven_item_optimize(owner_ptr, INVEN_RARM);
+       msg_format(_("%sを持ち替えた。", "You switched hand of %s."), o_name);
 }
 
 
@@ -547,7 +548,7 @@ void do_cmd_takeoff(player_type *creature_ptr)
        take_turn(creature_ptr, 50);
 
        /* Take off the item */
-       (void)inven_takeoff(item, 255);
+       (void)inven_takeoff(creature_ptr, item, 255);
        verify_equip_slot(creature_ptr, item);
        calc_android_exp(creature_ptr);
        creature_ptr->redraw |= (PR_EQUIPPY);
@@ -575,7 +576,7 @@ void do_cmd_drop(player_type *creature_ptr)
        q = _("どのアイテムを落としますか? ", "Drop which item? ");
        s = _("落とせるアイテムを持っていない。", "You have nothing to drop.");
 
-       o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
+       o_ptr = choose_object(creature_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
        if (!o_ptr) return;
 
        /* Hack -- Cannot remove cursed items */
@@ -594,7 +595,7 @@ void do_cmd_drop(player_type *creature_ptr)
        take_turn(creature_ptr, 50);
 
        /* Drop (some of) the item */
-       inven_drop(item, amt);
+       drop_from_inventory(creature_ptr, item, amt);
 
        if (item >= INVEN_RARM)
        {
@@ -608,6 +609,7 @@ void do_cmd_drop(player_type *creature_ptr)
 
 /*!
  * @brief アイテムを破壊するコマンドのメインルーチン / Destroy an item
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
  */
 void do_cmd_destroy(player_type *creature_ptr)
@@ -644,7 +646,7 @@ void do_cmd_destroy(player_type *creature_ptr)
        /* Verify unless quantity given beforehand */
        if (!force && (confirm_destroy || (object_value(o_ptr) > 0)))
        {
-               object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
+               object_desc(creature_ptr, o_name, o_ptr, OD_OMIT_PREFIX);
 
                /* Make a verification */
                sprintf(out_val, _("本当に%sを壊しますか? [y/n/Auto]", "Really destroy %s? [y/n/Auto]"), o_name);
@@ -653,7 +655,7 @@ void do_cmd_destroy(player_type *creature_ptr)
                /* HACK : Add the line to message buffer */
                message_add(out_val);
                creature_ptr->window |= (PW_MESSAGE);
-               handle_stuff();
+               handle_stuff(creature_ptr);
 
                /* Get an acceptable answer */
                while (TRUE)
@@ -681,10 +683,10 @@ void do_cmd_destroy(player_type *creature_ptr)
                        if (i == 'A')
                        {
                                /* Add an auto-destroy preference line */
-                               if (autopick_autoregister(o_ptr))
+                               if (autopick_autoregister(creature_ptr, o_ptr))
                                {
                                        /* Auto-destroy it */
-                                       autopick_alter_item(item, TRUE);
+                                       autopick_alter_item(creature_ptr, item, TRUE);
                                }
 
                                /* The object is already destroyed. */
@@ -702,7 +704,7 @@ void do_cmd_destroy(player_type *creature_ptr)
 
        old_number = o_ptr->number;
        o_ptr->number = amt;
-       object_desc(o_name, o_ptr, 0);
+       object_desc(creature_ptr, o_name, o_ptr, 0);
        o_ptr->number = old_number;
 
        take_turn(creature_ptr, 100);
@@ -724,21 +726,7 @@ void do_cmd_destroy(player_type *creature_ptr)
        /* Reduce the charges of rods/wands */
        reduce_charges(o_ptr, amt);
 
-       /* Eliminate the item (from the pack) */
-       if (item >= 0)
-       {
-               inven_item_increase(item, -amt);
-               inven_item_describe(item);
-               inven_item_optimize(item);
-       }
-
-       /* Eliminate the item (from the floor) */
-       else
-       {
-               floor_item_increase(0 - item, -amt);
-               floor_item_describe(0 - item);
-               floor_item_optimize(0 - item);
-       }
+       vary_item(creature_ptr, item, -amt);
 
        if (item_tester_high_level_book(q_ptr))
        {
@@ -825,9 +813,9 @@ void do_cmd_observe(player_type *creature_ptr)
                return;
        }
 
-       object_desc(o_name, o_ptr, 0);
+       object_desc(creature_ptr, o_name, o_ptr, 0);
        msg_format(_("%sを調べている...", "Examining %s..."), o_name);
-       if (!screen_object(o_ptr, SCROBJ_FORCE_DETAIL)) msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
+       if (!screen_object(creature_ptr, o_ptr, SCROBJ_FORCE_DETAIL)) msg_print(_("特に変わったところはないようだ。", "You see nothing special."));
 }
 
 
@@ -889,7 +877,7 @@ void do_cmd_inscribe(player_type *creature_ptr)
        if (!o_ptr) return;
 
        /* Describe the activity */
-       object_desc(o_name, o_ptr, OD_OMIT_INSCRIPTION);
+       object_desc(creature_ptr, o_name, o_ptr, OD_OMIT_INSCRIPTION);
 
        msg_format(_("%sに銘を刻む。", "Inscribing %s."), o_name);
        msg_print(NULL);
@@ -964,21 +952,7 @@ static void do_cmd_refill_lamp(player_type *user_ptr)
                msg_print(_("ランプの油は一杯だ。", "Your lamp is full."));
        }
 
-       /* Decrease the item (from the pack) */
-       if (item >= 0)
-       {
-               inven_item_increase(item, -1);
-               inven_item_describe(item);
-               inven_item_optimize(item);
-       }
-
-       /* Decrease the item (from the floor) */
-       else
-       {
-               floor_item_increase(0 - item, -1);
-               floor_item_describe(0 - item);
-               floor_item_optimize(0 - item);
-       }
+       vary_item(user_ptr, item, -1);
 
        user_ptr->update |= (PU_TORCH);
 }
@@ -988,7 +962,7 @@ static void do_cmd_refill_lamp(player_type *user_ptr)
  * Refuel the players torch (from the pack or floor)
  * @return なし
  */
-static void do_cmd_refill_torch(void)
+static void do_cmd_refill_torch(player_type *creature_ptr)
 {
        OBJECT_IDX item;
 
@@ -1003,13 +977,13 @@ static void do_cmd_refill_torch(void)
        q = _("どの松明で明かりを強めますか? ", "Refuel with which torch? ");
        s = _("他に松明がない。", "You have no extra torches.");
 
-       o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+       o_ptr = choose_object(creature_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
        if (!o_ptr) return;
 
-       take_turn(p_ptr, 50);
+       take_turn(creature_ptr, 50);
 
        /* Access the primary torch */
-       j_ptr = &p_ptr->inventory_list[INVEN_LITE];
+       j_ptr = &creature_ptr->inventory_list[INVEN_LITE];
 
        /* Refuel */
        j_ptr->xtra4 += o_ptr->xtra4 + 5;
@@ -1039,23 +1013,9 @@ static void do_cmd_refill_torch(void)
                msg_print(_("松明はいっそう明るく輝いた。", "Your torch glows more brightly."));
        }
 
-       /* Decrease the item (from the pack) */
-       if (item >= 0)
-       {
-               inven_item_increase(item, -1);
-               inven_item_describe(item);
-               inven_item_optimize(item);
-       }
+       vary_item(creature_ptr, item, -1);
 
-       /* Decrease the item (from the floor) */
-       else
-       {
-               floor_item_increase(0 - item, -1);
-               floor_item_describe(0 - item);
-               floor_item_optimize(0 - item);
-       }
-
-       p_ptr->update |= (PU_TORCH);
+       creature_ptr->update |= (PU_TORCH);
 }
 
 
@@ -1091,7 +1051,7 @@ void do_cmd_refill(player_type *creature_ptr)
        /* It's a torch */
        else if (o_ptr->sval == SV_LITE_TORCH)
        {
-               do_cmd_refill_torch();
+               do_cmd_refill_torch(creature_ptr);
        }
 
        /* No torch to refill */
@@ -1107,12 +1067,12 @@ void do_cmd_refill(player_type *creature_ptr)
  * Target command
  * @return なし
  */
-void do_cmd_target(void)
+void do_cmd_target(player_type *creature_ptr)
 {
-       if (p_ptr->wild_mode) return;
+       if (creature_ptr->wild_mode) return;
 
        /* Target set */
-       if (target_set(TARGET_KILL))
+       if (target_set(creature_ptr, TARGET_KILL))
        {
                msg_print(_("ターゲット決定。", "Target Selected."));
        }
@@ -1125,19 +1085,18 @@ void do_cmd_target(void)
 }
 
 
-
 /*!
  * @brief 周囲を見渡すコマンドのメインルーチン
  * Look command
  * @return なし
  */
-void do_cmd_look(void)
+void do_cmd_look(player_type *creature_ptr)
 {
-       p_ptr->window |= PW_MONSTER_LIST;
-       handle_stuff();
+       creature_ptr->window |= PW_MONSTER_LIST;
+       handle_stuff(creature_ptr);
 
        /* Look around */
-       if (target_set(TARGET_LOOK))
+       if (target_set(creature_ptr, TARGET_LOOK))
        {
                msg_print(_("ターゲット決定。", "Target Selected."));
        }
@@ -1164,7 +1123,7 @@ void do_cmd_locate(player_type *creature_ptr)
        x2 = x1 = panel_col_min;
 
        /* Show panels until done */
-       while (1)
+       while (TRUE)
        {
                /* Describe the location */
                if ((y2 == y1) && (x2 == x1))
@@ -1206,7 +1165,7 @@ void do_cmd_locate(player_type *creature_ptr)
                if (!dir) break;
 
                /* Apply the motion */
-               if (change_panel(ddy[dir], ddx[dir]))
+               if (change_panel(creature_ptr, ddy[dir], ddx[dir]))
                {
                        y2 = panel_row_min;
                        x2 = panel_col_min;
@@ -1215,18 +1174,19 @@ void do_cmd_locate(player_type *creature_ptr)
 
 
        /* Recenter the map around the player */
-       verify_panel();
+       verify_panel(creature_ptr);
 
        creature_ptr->update |= (PU_MONSTERS);
        creature_ptr->redraw |= (PR_MAP);
        creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
-       handle_stuff();
+       handle_stuff(creature_ptr);
 }
 
 
 /*!
  * @brief モンスターの思い出を見るコマンドのメインルーチン
  * Identify a character, allow recall of monsters
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @return なし
  * @details
  * <pre>
@@ -1240,7 +1200,7 @@ void do_cmd_locate(player_type *creature_ptr)
  * Note that the player ghosts are ignored. 
  * </pre>
  */
-void do_cmd_query_symbol(void)
+void do_cmd_query_symbol(player_type *creature_ptr)
 {
        IDX i;
        int n;
@@ -1404,28 +1364,27 @@ void do_cmd_query_symbol(void)
                ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
        }
 
-
        /* Start at the end */
        i = n - 1;
 
        /* Scan the monster memory */
-       while (1)
+       while (TRUE)
        {
                r_idx = who[i];
 
                /* Hack -- Auto-recall */
-               monster_race_track(r_idx);
-               handle_stuff();
+               monster_race_track(creature_ptr, r_idx);
+               handle_stuff(creature_ptr);
 
                /* Interact */
-               while (1)
+               while (TRUE)
                {
                        if (recall)
                        {
                                screen_save();
 
                                /* Recall on screen */
-                               screen_roff(who[i], 0);
+                               screen_roff(creature_ptr, who[i], 0);
                        }
 
                        /* Hack -- Begin the prompt */