• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

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

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -65,7 +65,7 @@ void do_cmd_inven(void)
6565 screen_save();
6666
6767 /* Display the p_ptr->inventory_list */
68- (void)show_inven(0, USE_FULL);
68+ (void)show_inven(0, USE_FULL, item_tester_tval);
6969
7070 #ifdef JP
7171 sprintf(out_val, "持ち物: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
@@ -117,7 +117,7 @@ void do_cmd_equip(void)
117117 if (easy_floor) command_wrk = (USE_EQUIP);
118118 screen_save();
119119
120- (void)show_equip(0, USE_FULL);
120+ (void)show_equip(0, USE_FULL, item_tester_tval);
121121
122122 /* Build a prompt */
123123 #ifdef JP
--- a/src/files.c
+++ b/src/files.c
@@ -6497,7 +6497,7 @@ void show_info(void)
64976497 if (p_ptr->equip_cnt)
64986498 {
64996499 Term_clear();
6500- (void)show_equip(0, USE_FULL);
6500+ (void)show_equip(0, USE_FULL, item_tester_tval);
65016501 prt(_("装備していたアイテム: -続く-", "You are using: -more-"), 0, 0);
65026502
65036503 if (inkey() == ESCAPE) return;
@@ -6507,7 +6507,7 @@ void show_info(void)
65076507 if (p_ptr->inven_cnt)
65086508 {
65096509 Term_clear();
6510- (void)show_inven(0, USE_FULL);
6510+ (void)show_inven(0, USE_FULL, item_tester_tval);
65116511 prt(_("持っていたアイテム: -続く-", "You are carrying: -more-"), 0, 0);
65126512
65136513 if (inkey() == ESCAPE) return;
--- a/src/object.h
+++ b/src/object.h
@@ -417,8 +417,8 @@ extern bool check_book_realm(const OBJECT_TYPE_VALUE book_tval, const OBJECT_SUB
417417 extern bool item_tester_okay(object_type *o_ptr, OBJECT_TYPE_VALUE tval);
418418 extern void display_inven(void);
419419 extern void display_equip(void);
420-extern COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode);
421-extern COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode);
420+extern COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval);
421+extern COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval);
422422 extern void toggle_inven_equip(void);
423423
424424 /*
--- a/src/player-inventory.c
+++ b/src/player-inventory.c
@@ -499,7 +499,7 @@ static void prepare_label_string_floor(char *label, FLOOR_IDX floor_list[], ITEM
499499 * @details
500500 * Hack -- do not display "trailing" empty slots
501501 */
502-COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode)
502+COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
503503 {
504504 COMMAND_CODE i;
505505 int j, k, l, z = 0;
@@ -533,7 +533,7 @@ COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode)
533533 z = i + 1;
534534 }
535535
536- prepare_label_string(inven_label, USE_INVEN, item_tester_tval);
536+ prepare_label_string(inven_label, USE_INVEN, tval);
537537
538538 /* Display the p_ptr->inventory_list */
539539 for (k = 0, i = 0; i < z; i++)
@@ -541,7 +541,7 @@ COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode)
541541 o_ptr = &p_ptr->inventory_list[i];
542542
543543 /* Is this item acceptable? */
544- if (!item_tester_okay(o_ptr, item_tester_tval) && !(mode & USE_FULL)) continue;
544+ if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
545545
546546 object_desc(o_name, o_ptr, 0);
547547
@@ -1069,14 +1069,14 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
10691069 if (!command_wrk)
10701070 {
10711071 /* Redraw if needed */
1072- if (command_see) get_item_label = show_inven(menu_line, mode);
1072+ if (command_see) get_item_label = show_inven(menu_line, mode, item_tester_tval);
10731073 }
10741074
10751075 /* Equipment screen */
10761076 else
10771077 {
10781078 /* Redraw if needed */
1079- if (command_see) get_item_label = show_equip(menu_line, mode);
1079+ if (command_see) get_item_label = show_equip(menu_line, mode, item_tester_tval);
10801080 }
10811081
10821082 /* Viewing p_ptr->inventory_list */
@@ -2072,7 +2072,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode,
20722072 n2 = I2A(i2);
20732073
20742074 /* Redraw if needed */
2075- if (command_see) get_item_label = show_inven(menu_line, mode);
2075+ if (command_see) get_item_label = show_inven(menu_line, mode, item_tester_tval);
20762076 }
20772077
20782078 /* Equipment screen */
@@ -2083,7 +2083,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode,
20832083 n2 = I2A(e2 - INVEN_RARM);
20842084
20852085 /* Redraw if needed */
2086- if (command_see) get_item_label = show_equip(menu_line, mode);
2086+ if (command_see) get_item_label = show_equip(menu_line, mode, item_tester_tval);
20872087 }
20882088
20892089 /* Floor screen */
@@ -3223,7 +3223,7 @@ void display_inven(void)
32233223 * @param target_item アイテムの選択処理を行うか否か。
32243224 * @return 選択したアイテムのタグ
32253225 */
3226-COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode)
3226+COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
32273227 {
32283228 COMMAND_CODE i;
32293229 int j, k, l;
@@ -3253,7 +3253,7 @@ COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode)
32533253 o_ptr = &p_ptr->inventory_list[i];
32543254
32553255 /* Is this item acceptable? */
3256- if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr, item_tester_tval) || (mode & USE_FULL)) &&
3256+ if (!(select_ring_slot ? is_ring_slot(i) : item_tester_okay(o_ptr, tval) || (mode & USE_FULL)) &&
32573257 (!((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute) ||
32583258 (mode & IGNORE_BOTHHAND_SLOT))) continue;
32593259
@@ -3312,7 +3312,7 @@ COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode)
33123312 col = (len > wid - 4) ? 0 : (wid - len - 1);
33133313 #endif
33143314
3315- prepare_label_string(equip_label, USE_EQUIP, item_tester_tval);
3315+ prepare_label_string(equip_label, USE_EQUIP, tval);
33163316
33173317 /* Output each entry */
33183318 for (j = 0; j < k; j++)
Show on old repository browser