OSDN Git Service

[Refactor] #38997 get_spike() に player_type * 引数を追加.
authordeskull <deskull@users.sourceforge.jp>
Mon, 29 Jul 2019 10:31:32 +0000 (19:31 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 29 Jul 2019 10:31:32 +0000 (19:31 +0900)
src/cmd-basic.c

index 528ca68..484c176 100644 (file)
@@ -1913,7 +1913,7 @@ void do_cmd_alter(player_type *creature_ptr)
 
 
 /*!
- * @brief ã\80\8cã\81\8fã\81\95ã\81³ã\82\92æ\89\93ã\81¤ã\80\8dã\81\9fã\82\81ã\81«å¿\85è¦\81ã\81ªã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88ã\81\8cã\81\82るかどうかの判定を返す /
+ * @brief ã\80\8cã\81\8fã\81\95ã\81³ã\82\92æ\89\93ã\81¤ã\80\8dã\81\9fã\82\81ã\81«å¿\85è¦\81ã\81ªã\82ªã\83\96ã\82¸ã\82§ã\82¯ã\83\88ã\82\92æ\89\80æ\8c\81ã\81\97ã\81¦ã\81\84るかどうかの判定を返す /
  * Find the index of some "spikes", if possible.
  * @param ip くさびとして打てるオブジェクトのID
  * @return オブジェクトがある場合TRUEを返す
@@ -1922,14 +1922,14 @@ void do_cmd_alter(player_type *creature_ptr)
  * Let user choose a pile of spikes, perhaps?
  * </pre>
  */
-static bool get_spike(INVENTORY_IDX *ip)
+static bool get_spike(player_type *creature_ptr, INVENTORY_IDX *ip)
 {
        INVENTORY_IDX i;
 
        /* Check every item in the pack */
        for (i = 0; i < INVEN_PACK; i++)
        {
-               object_type *o_ptr = &p_ptr->inventory_list[i];
+               object_type *o_ptr = &creature_ptr->inventory_list[i];
                if (!o_ptr->k_idx) continue;
 
                /* Check the "tval" code */
@@ -1988,7 +1988,7 @@ void do_cmd_spike(player_type *creature_ptr)
                }
 
                /* Get a spike */
-               else if (!get_spike(&item))
+               else if (!get_spike(creature_ptr, &item))
                {
                        msg_print(_("くさびを持っていない!", "You have no spikes!"));
                }