• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision709baff498c852f1a69fd1f674af69e6b7a09717 (tree)
Time2019-06-15 09:16:53
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/player-inventory.c
+++ b/src/player-inventory.c
@@ -500,7 +500,7 @@ static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], IT
500500 * Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
501501 * and "x" is the "current" command_cmd code.\n
502502 */
503-static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
503+static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
504504 {
505505 COMMAND_CODE i;
506506 COMMAND_CODE start, end;
@@ -535,7 +535,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
535535 if (!o_ptr->inscription) continue;
536536
537537 /* Skip non-choice */
538- if (!item_tester_okay(o_ptr, item_tester_tval) && !(mode & USE_FULL)) continue;
538+ if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
539539
540540 /* Find a '@' */
541541 s = my_strchr(quark_str(o_ptr->inscription), '@');
@@ -578,7 +578,7 @@ static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
578578 if (!o_ptr->inscription) continue;
579579
580580 /* Skip non-choice */
581- if (!item_tester_okay(o_ptr, item_tester_tval) && !(mode & USE_FULL)) continue;
581+ if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
582582
583583 /* Find a '@' */
584584 s = my_strchr(quark_str(o_ptr->inscription), '@');
@@ -628,7 +628,7 @@ void prepare_label_string(char *label, BIT_FLAGS mode)
628628 SYMBOL_CODE c = alphabet_chars[i];
629629
630630 /* Find a tag with this label */
631- if (get_tag(&index, c, mode))
631+ if (get_tag(&index, c, mode, item_tester_tval))
632632 {
633633 /* Delete the overwritten label */
634634 if (label[i] == c) label[i] = ' ';
@@ -1059,7 +1059,7 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
10591059 if (prev_tag && command_cmd)
10601060 {
10611061 /* Look up the tag and validate the item */
1062- if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
1062+ if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN, item_tester_tval)) /* Reject */;
10631063 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
10641064 else if (!get_item_okay(k)) /* Reject */;
10651065 else
@@ -1536,7 +1536,7 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
15361536 case '7': case '8': case '9':
15371537 {
15381538 /* Look up the tag */
1539- if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
1539+ if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN, item_tester_tval))
15401540 {
15411541 bell();
15421542 break;
@@ -1627,7 +1627,7 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
16271627 bool not_found = FALSE;
16281628
16291629 /* Look up the alphabetical tag */
1630- if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
1630+ if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN, item_tester_tval))
16311631 {
16321632 not_found = TRUE;
16331633 }
@@ -2052,7 +2052,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
20522052 if (prev_tag && command_cmd)
20532053 {
20542054 /* Look up the tag and validate the item */
2055- if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
2055+ if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN, item_tester_tval)) /* Reject */;
20562056 else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
20572057 else if (!get_item_okay(k)) /* Reject */;
20582058 else
@@ -2809,7 +2809,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
28092809 if (command_wrk != USE_FLOOR)
28102810 {
28112811 /* Look up the tag */
2812- if (!get_tag(&k, which, command_wrk))
2812+ if (!get_tag(&k, which, command_wrk, item_tester_tval))
28132813 {
28142814 bell();
28152815 break;
@@ -2941,7 +2941,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
29412941 bool not_found = FALSE;
29422942
29432943 /* Look up the alphabetical tag */
2944- if (!get_tag(&k, which, command_wrk))
2944+ if (!get_tag(&k, which, command_wrk, item_tester_tval))
29452945 {
29462946 not_found = TRUE;
29472947 }
Show on old repository browser