return FALSE;
if (*prev_tag && command_cmd) {
- fis_ptr->floor_num = scan_floor_items(owner_ptr, fis_ptr->floor_list, owner_ptr->y, owner_ptr->x, 0x03, fis_ptr->tval);
+ fis_ptr->floor_num
+ = scan_floor_items(owner_ptr, fis_ptr->floor_list, owner_ptr->y, owner_ptr->x, SCAN_FLOOR_ITEM_TESTER | SCAN_FLOOR_ONLY_MARKED, fis_ptr->tval);
if (get_tag_floor(owner_ptr->current_floor_ptr, &fis_ptr->k, *prev_tag, fis_ptr->floor_list, fis_ptr->floor_num)) {
*fis_ptr->cp = 0 - fis_ptr->floor_list[fis_ptr->k];
- fis_ptr->tval = 0;
+ fis_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
if (!item_tester_okay(owner_ptr, &owner_ptr->current_floor_ptr->o_list[0 - (*fis_ptr->cp)], fis_ptr->tval) && ((fis_ptr->mode & USE_FULL) == 0))
return FALSE;
- fis_ptr->tval = 0;
+ fis_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
*/
static bool get_floor_item_tag_inventory(player_type *owner_ptr, fis_type *fis_ptr, char *prev_tag)
{
- if ((*prev_tag == '\0') || !command_cmd)
- return FALSE;
-
bool flag = FALSE;
item_use_flag use_flag = (*fis_ptr->cp >= INVEN_MAIN_HAND) ? USE_EQUIP : USE_INVEN;
else
flag |= !fis_ptr->equip;
- if (!flag) {
+ if (flag) {
*prev_tag = '\0';
return FALSE;
}
&& (!fis_ptr->equip || (*fis_ptr->cp < INVEN_MAIN_HAND) || (*fis_ptr->cp >= INVEN_TOTAL)))
return FALSE;
- if (get_floor_item_tag_inventory(owner_ptr, fis_ptr, prev_tag))
- return TRUE;
+ if ((*prev_tag != '\0') && command_cmd)
+ return get_floor_item_tag_inventory(owner_ptr, fis_ptr, prev_tag);
if (get_item_okay(owner_ptr, *fis_ptr->cp, fis_ptr->tval)) {
- fis_ptr->tval = 0;
+ fis_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
return FALSE;
if (fis_ptr->force && (*fis_ptr->cp == INVEN_FORCE)) {
- fis_ptr->tval = 0;
+ fis_ptr->tval = TV_NONE;
item_tester_hook = NULL;
command_cmd = 0;
return TRUE;
if (!use_menu)
return;
- for (inventory_slot_type i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++)
+ for (int i = INVEN_MAIN_HAND; i < INVEN_TOTAL; i++)
if (owner_ptr->select_ring_slot ? is_ring_slot(i)
: item_tester_okay(owner_ptr, &owner_ptr->inventory_list[i], fis_ptr->tval) || (fis_ptr->mode & USE_FULL))
fis_ptr->max_equip++;
fis_ptr->floor_num = 0;
if (fis_ptr->floor)
- fis_ptr->floor_num = scan_floor_items(owner_ptr, fis_ptr->floor_list, owner_ptr->y, owner_ptr->x, 0x03, fis_ptr->tval);
+ fis_ptr->floor_num
+ = scan_floor_items(owner_ptr, fis_ptr->floor_list, owner_ptr->y, owner_ptr->x, SCAN_FLOOR_ITEM_TESTER | SCAN_FLOOR_ONLY_MARKED, fis_ptr->tval);
if ((mode & USE_INVEN) && (fis_ptr->i1 <= fis_ptr->i2))
fis_ptr->allow_inven = TRUE;
fis_ptr->toggle = !fis_ptr->toggle;
}
- owner_ptr->window |= (PW_INVEN | PW_EQUIP);
+ owner_ptr->window_flags |= (PW_INVEN | PW_EQUIP);
handle_stuff(owner_ptr);
COMMAND_CODE get_item_label = 0;
if (command_wrk == USE_INVEN) {
if (command_wrk == USE_INVEN) {
sprintf(fis_ptr->out_val, _("持ち物:", "Inven:"));
if (!use_menu) {
- sprintf(fis_ptr->tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), index_to_label(fis_ptr->i1), index_to_label(fis_ptr->i2));
- strcat(fis_ptr->out_val, fis_ptr->tmp_val);
+ char tmp_val[80];
+ sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), index_to_label(fis_ptr->i1), index_to_label(fis_ptr->i2));
+ strcat(fis_ptr->out_val, tmp_val);
}
if (!command_see && !use_menu)
} else if (command_wrk == (USE_EQUIP)) {
sprintf(fis_ptr->out_val, _("装備品:", "Equip:"));
if (!use_menu) {
- sprintf(fis_ptr->tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), index_to_label(fis_ptr->e1), index_to_label(fis_ptr->e2));
- strcat(fis_ptr->out_val, fis_ptr->tmp_val);
+ char tmp_val[80];
+ sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), index_to_label(fis_ptr->e1), index_to_label(fis_ptr->e2));
+ strcat(fis_ptr->out_val, tmp_val);
}
if (!command_see && !use_menu)
} else if (command_wrk == USE_FLOOR) {
sprintf(fis_ptr->out_val, _("床上:", "Floor:"));
if (!use_menu) {
- sprintf(fis_ptr->tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), fis_ptr->n1, fis_ptr->n2);
- strcat(fis_ptr->out_val, fis_ptr->tmp_val);
+ char tmp_val[80];
+ sprintf(tmp_val, _("%c-%c,'(',')',", " %c-%c,'(',')',"), fis_ptr->n1, fis_ptr->n2);
+ strcat(fis_ptr->out_val, tmp_val);
}
if (!command_see && !use_menu)
i = owner_ptr->current_floor_ptr->o_list[i].next_o_idx;
owner_ptr->current_floor_ptr->o_list[i].next_o_idx = o_idx;
- fis_ptr->floor_num = scan_floor_items(owner_ptr, fis_ptr->floor_list, owner_ptr->y, owner_ptr->x, 0x03, fis_ptr->tval);
+ fis_ptr->floor_num
+ = scan_floor_items(owner_ptr, fis_ptr->floor_list, owner_ptr->y, owner_ptr->x, SCAN_FLOOR_ITEM_TESTER | SCAN_FLOOR_ONLY_MARKED, fis_ptr->tval);
if (command_see) {
screen_load();
screen_save();
command_see = FALSE;
}
- fis_ptr->tval = 0;
+ fis_ptr->tval = TV_NONE;
item_tester_hook = NULL;
if (fis_ptr->toggle)
toggle_inventory_equipment(owner_ptr);
- owner_ptr->window |= (PW_INVEN | PW_EQUIP);
+ owner_ptr->window_flags |= (PW_INVEN | PW_EQUIP);
handle_stuff(owner_ptr);
prt("", 0, 0);
if (fis_ptr->oops && str)
}
return fis_ptr->item;
-}
\ No newline at end of file
+}