• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision2537fc4a317a29beba0c01793adf4ebdeb87b2f9 (tree)
Time2019-06-15 16:27:19
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #39068 can_get_item() の item_tester_tval グローバル参照をローカル引数に収める.

Change Summary

Incremental Difference

--- a/src/object.h
+++ b/src/object.h
@@ -430,7 +430,7 @@ extern void toggle_inven_equip(void);
430430 #define USE_FORCE 0x08 /*!< 特殊: wキーで錬気術への切り替えを許可する */
431431 #define IGNORE_BOTHHAND_SLOT 0x10 /*!< アイテム表示/選択範囲: 両手持ちスロットを選択に含めない */
432432 #define USE_FULL 0x20 /*!< アイテム表示/選択範囲: 空欄まですべて表示する*/
433-extern bool can_get_item(void);
433+extern bool can_get_item(OBJECT_TYPE_VALUE tval);
434434 extern bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode);
435435 extern object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option);
436436 PERCENTAGE breakage_chance(object_type *o_ptr, SPELL_IDX snipe_type);
--- a/src/player-inventory.c
+++ b/src/player-inventory.c
@@ -186,14 +186,14 @@ bool get_item_okay(OBJECT_IDX i)
186186 * @return アイテムを拾えるならばTRUEを返す。
187187 * @details assuming mode = (USE_EQUIP | USE_INVEN | USE_FLOOR).
188188 */
189-bool can_get_item(void)
189+bool can_get_item(OBJECT_TYPE_VALUE tval)
190190 {
191191 int j;
192192 OBJECT_IDX floor_list[23];
193193 ITEM_NUMBER floor_num = 0;
194194
195195 for (j = 0; j < INVEN_TOTAL; j++)
196- if (item_tester_okay(&p_ptr->inventory_list[j], item_tester_tval))
196+ if (item_tester_okay(&p_ptr->inventory_list[j], tval))
197197 return TRUE;
198198
199199 floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -2094,7 +2094,7 @@ bool ident_spell(bool only_equip)
20942094 else
20952095 item_tester_hook = item_tester_hook_identify;
20962096
2097- if (can_get_item())
2097+ if (can_get_item(item_tester_tval))
20982098 {
20992099 q = _("どのアイテムを鑑定しますか? ", "Identify which item? ");
21002100 }
@@ -2210,7 +2210,7 @@ bool identify_fully(bool only_equip)
22102210 else
22112211 item_tester_hook = item_tester_hook_identify_fully;
22122212
2213- if (can_get_item())
2213+ if (can_get_item(item_tester_tval))
22142214 {
22152215 q = _("どのアイテムを*鑑定*しますか? ", "*Identify* which item? ");
22162216 }
Show on old repository browser