OSDN Git Service

[Refactor] #39068 can_get_item() の item_tester_tval グローバル参照をローカル引数に収める.
authordeskull <deskull@users.sourceforge.jp>
Sat, 15 Jun 2019 00:47:31 +0000 (09:47 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 15 Jun 2019 07:27:19 +0000 (16:27 +0900)
src/object.h
src/player-inventory.c
src/spells3.c

index 70ab865..4ddd873 100644 (file)
@@ -430,7 +430,7 @@ extern void toggle_inven_equip(void);
 #define USE_FORCE 0x08 /*!< \93Á\8eê: w\83L\81[\82Å\98B\8bC\8fp\82Ö\82Ì\90Ø\82è\91Ö\82¦\82ð\8b\96\89Â\82·\82é */
 #define IGNORE_BOTHHAND_SLOT 0x10 /*!< \83A\83C\83e\83\80\95\\8e¦/\91I\91ð\94Í\88Í: \97¼\8eè\8e\9d\82¿\83X\83\8d\83b\83g\82ð\91I\91ð\82É\8aÜ\82ß\82È\82¢ */
 #define USE_FULL  0x20 /*!< \83A\83C\83e\83\80\95\\8e¦/\91I\91ð\94Í\88Í: \8bó\97\93\82Ü\82Å\82·\82×\82Ä\95\\8e¦\82·\82é*/
-extern bool can_get_item(void);
+extern bool can_get_item(OBJECT_TYPE_VALUE tval);
 extern bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode);
 extern object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option);
 PERCENTAGE breakage_chance(object_type *o_ptr, SPELL_IDX snipe_type);
index faa44c3..c6acdb9 100644 (file)
@@ -186,14 +186,14 @@ bool get_item_okay(OBJECT_IDX i)
  * @return アイテムを拾えるならばTRUEを返す。
  * @details assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
  */
-bool can_get_item(void)
+bool can_get_item(OBJECT_TYPE_VALUE tval)
 {
        int j;
        OBJECT_IDX floor_list[23];
        ITEM_NUMBER floor_num = 0;
 
        for (j = 0; j < INVEN_TOTAL; j++)
-               if (item_tester_okay(&p_ptr->inventory_list[j], item_tester_tval))
+               if (item_tester_okay(&p_ptr->inventory_list[j], tval))
                        return TRUE;
 
        floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
index 3a41474..71b90fa 100644 (file)
@@ -2094,7 +2094,7 @@ bool ident_spell(bool only_equip)
        else
                item_tester_hook = item_tester_hook_identify;
 
-       if (can_get_item())
+       if (can_get_item(item_tester_tval))
        {
                q = _("どのアイテムを鑑定しますか? ", "Identify which item? ");
        }
@@ -2210,7 +2210,7 @@ bool identify_fully(bool only_equip)
        else
                item_tester_hook = item_tester_hook_identify_fully;
 
-       if (can_get_item())
+       if (can_get_item(item_tester_tval))
        {
                q = _("どのアイテムを*鑑定*しますか? ", "*Identify* which item? ");
        }