* Also, the tag "@xn" will work as well, where "n" is a any tag-char,\n
* and "x" is the "current" command_cmd code.\n
*/
-static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode)
+static bool get_tag(COMMAND_CODE *cp, char tag, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
{
COMMAND_CODE i;
COMMAND_CODE start, end;
if (!o_ptr->inscription) continue;
/* Skip non-choice */
- if (!item_tester_okay(o_ptr, item_tester_tval) && !(mode & USE_FULL)) continue;
+ if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
/* Find a '@' */
s = my_strchr(quark_str(o_ptr->inscription), '@');
if (!o_ptr->inscription) continue;
/* Skip non-choice */
- if (!item_tester_okay(o_ptr, item_tester_tval) && !(mode & USE_FULL)) continue;
+ if (!item_tester_okay(o_ptr, tval) && !(mode & USE_FULL)) continue;
/* Find a '@' */
s = my_strchr(quark_str(o_ptr->inscription), '@');
SYMBOL_CODE c = alphabet_chars[i];
/* Find a tag with this label */
- if (get_tag(&index, c, mode))
+ if (get_tag(&index, c, mode, item_tester_tval))
{
/* Delete the overwritten label */
if (label[i] == c) label[i] = ' ';
if (prev_tag && command_cmd)
{
/* Look up the tag and validate the item */
- if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
+ if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN, item_tester_tval)) /* Reject */;
else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
else if (!get_item_okay(k)) /* Reject */;
else
case '7': case '8': case '9':
{
/* Look up the tag */
- if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
+ if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN, item_tester_tval))
{
bell();
break;
bool not_found = FALSE;
/* Look up the alphabetical tag */
- if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN))
+ if (!get_tag(&k, which, command_wrk ? USE_EQUIP : USE_INVEN, item_tester_tval))
{
not_found = TRUE;
}
if (prev_tag && command_cmd)
{
/* Look up the tag and validate the item */
- if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN)) /* Reject */;
+ if (!get_tag(&k, prev_tag, (*cp >= INVEN_RARM) ? USE_EQUIP : USE_INVEN, item_tester_tval)) /* Reject */;
else if ((k < INVEN_RARM) ? !inven : !equip) /* Reject */;
else if (!get_item_okay(k)) /* Reject */;
else
if (command_wrk != USE_FLOOR)
{
/* Look up the tag */
- if (!get_tag(&k, which, command_wrk))
+ if (!get_tag(&k, which, command_wrk, item_tester_tval))
{
bell();
break;
bool not_found = FALSE;
/* Look up the alphabetical tag */
- if (!get_tag(&k, which, command_wrk))
+ if (!get_tag(&k, which, command_wrk, item_tester_tval))
{
not_found = TRUE;
}