• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

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

Log Message

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

Change Summary

Incremental Difference

--- a/src/object.h
+++ b/src/object.h
@@ -520,9 +520,9 @@ extern concptr essence_name[];
520520
521521 extern s32b flag_cost(object_type *o_ptr, int plusses);
522522
523-extern bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode);
523+extern bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval);
524524 extern void py_pickup_floor(bool pickup);
525-extern void prepare_label_string(char *label, BIT_FLAGS mode);
525+extern void prepare_label_string(char *label, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval);
526526
527527 /*
528528 * Return the "attr" for a given item.
--- a/src/player-inventory.c
+++ b/src/player-inventory.c
@@ -827,7 +827,7 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
827827 static char prev_tag = '\0';
828828 char cur_tag = '\0';
829829
830- if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode);
830+ if (easy_floor || use_menu) return get_item_floor(cp, pmt, str, mode, item_tester_tval);
831831
832832 /* Extract args */
833833 if (mode & USE_EQUIP) equip = TRUE;
@@ -1770,7 +1770,7 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
17701770 * @param mode オプションフラグ
17711771 * @return プレイヤーによりアイテムが選択されたならTRUEを返す。/
17721772 */
1773-bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
1773+bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
17741774 {
17751775 char n1 = ' ', n2 = ' ', which = ' ';
17761776
@@ -1816,7 +1816,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
18161816 /* the_force */
18171817 if (force && (*cp == INVEN_FORCE))
18181818 {
1819- item_tester_tval = 0;
1819+ tval = 0;
18201820 item_tester_hook = NULL;
18211821 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
18221822 return (TRUE);
@@ -1837,7 +1837,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
18371837 (*cp) = 0 - floor_list[k];
18381838
18391839 /* Forget restrictions */
1840- item_tester_tval = 0;
1840+ tval = 0;
18411841 item_tester_hook = NULL;
18421842 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
18431843
@@ -1849,10 +1849,10 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
18491849 }
18501850
18511851 /* Validate the item */
1852- else if (item_tester_okay(&current_floor_ptr->o_list[0 - (*cp)], item_tester_tval) || (mode & USE_FULL))
1852+ else if (item_tester_okay(&current_floor_ptr->o_list[0 - (*cp)], tval) || (mode & USE_FULL))
18531853 {
18541854 /* Forget restrictions */
1855- item_tester_tval = 0;
1855+ tval = 0;
18561856 item_tester_hook = NULL;
18571857 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
18581858
@@ -1867,7 +1867,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
18671867 if (prev_tag && command_cmd)
18681868 {
18691869 /* Look up the tag and validate the item */
1870- if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN, item_tester_tval)) /* Reject */;
1870+ if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN, tval)) /* Reject */;
18711871 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
18721872 else if (!get_item_okay(k)) /* Reject */;
18731873 else
@@ -1876,7 +1876,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
18761876 (*cp) = k;
18771877
18781878 /* Forget restrictions */
1879- item_tester_tval = 0;
1879+ tval = 0;
18801880 item_tester_hook = NULL;
18811881 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
18821882
@@ -1891,7 +1891,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
18911891 else if (get_item_okay(*cp))
18921892 {
18931893 /* Forget restrictions */
1894- item_tester_tval = 0;
1894+ tval = 0;
18951895 item_tester_hook = NULL;
18961896 command_cmd = 0; /* Hack -- command_cmd is no longer effective */
18971897
@@ -1920,7 +1920,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
19201920 else if (use_menu)
19211921 {
19221922 for (j = 0; j < INVEN_PACK; j++)
1923- if (item_tester_okay(&p_ptr->inventory_list[j], item_tester_tval) || (mode & USE_FULL)) max_inven++;
1923+ if (item_tester_okay(&p_ptr->inventory_list[j], tval) || (mode & USE_FULL)) max_inven++;
19241924 }
19251925
19261926 /* Restrict p_ptr->inventory_list indexes */
@@ -1937,7 +1937,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
19371937 else if (use_menu)
19381938 {
19391939 for (j = INVEN_RARM; j < INVEN_TOTAL; j++)
1940- if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&p_ptr->inventory_list[j], item_tester_tval) || (mode & USE_FULL)) max_equip++;
1940+ if (select_ring_slot ? is_ring_slot(j) : item_tester_okay(&p_ptr->inventory_list[j], tval) || (mode & USE_FULL)) max_equip++;
19411941 if (p_ptr->ryoute && !(mode & IGNORE_BOTHHAND_SLOT)) max_equip++;
19421942 }
19431943
@@ -2624,7 +2624,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
26242624 if (command_wrk != USE_FLOOR)
26252625 {
26262626 /* Look up the tag */
2627- if (!get_tag(&k, which, command_wrk, item_tester_tval))
2627+ if (!get_tag(&k, which, command_wrk, tval))
26282628 {
26292629 bell();
26302630 break;
@@ -2756,7 +2756,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
27562756 bool not_found = FALSE;
27572757
27582758 /* Look up the alphabetical tag */
2759- if (!get_tag(&k, which, command_wrk, item_tester_tval))
2759+ if (!get_tag(&k, which, command_wrk, tval))
27602760 {
27612761 not_found = TRUE;
27622762 }
@@ -2877,8 +2877,8 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
28772877 }
28782878
28792879
2880- /* Forget the item_tester_tval restriction */
2881- item_tester_tval = 0;
2880+ /* Forget the tval restriction */
2881+ tval = 0;
28822882
28832883 /* Forget the item_tester_hook restriction */
28842884 item_tester_hook = NULL;
Show on old repository browser