* @param fis_ptr 床上アイテムへの参照ポインタ
* @return なし
*/
-static void test_inventory(player_type *owner_ptr, fis_type *fis_ptr)
+static void test_inventory_floor(player_type *owner_ptr, fis_type *fis_ptr)
{
if (!fis_ptr->inven) {
fis_ptr->i2 = -1;
* @param fis_ptr 床上アイテムへの参照ポインタ
* @return なし
*/
-static void test_equipment(player_type *owner_ptr, fis_type *fis_ptr)
+static void test_equipment_floor(player_type *owner_ptr, fis_type *fis_ptr)
{
if (!fis_ptr->equip) {
fis_ptr->e2 = -1;
return TRUE;
msg_print(NULL);
- test_inventory(owner_ptr, fis_ptr);
+ test_inventory_floor(owner_ptr, fis_ptr);
fis_ptr->done = FALSE;
fis_ptr->item = FALSE;
fis_ptr->i1 = 0;
fis_ptr->e1 = INVEN_RARM;
fis_ptr->e2 = INVEN_TOTAL - 1;
- test_equipment(owner_ptr, fis_ptr);
+ test_equipment_floor(owner_ptr, fis_ptr);
if (owner_ptr->ryoute && !(fis_ptr->mode & IGNORE_BOTHHAND_SLOT))
fis_ptr->max_equip++;
}
/*!
+ * @brief インベントリ内のアイテムが妥当かを判定する
+ * @param owner_ptr プレーヤーへの参照ポインタ
+ * @param fis_ptr アイテム選択への参照ポインタ
+ * @return なし
+ */
+static void test_inventory(player_type *owner_ptr, item_selection_type *item_selection_ptr)
+{
+ if (!item_selection_ptr->inven) {
+ item_selection_ptr->i2 = -1;
+ return;
+ }
+
+ if (!use_menu)
+ return;
+
+ for (int j = 0; j < INVEN_PACK; j++)
+ if (item_tester_okay(owner_ptr, &owner_ptr->inventory_list[j], item_selection_ptr->tval) || (item_selection_ptr->mode & USE_FULL))
+ item_selection_ptr->max_inven++;
+}
+
+/*!
* @brief オブジェクト選択の汎用関数 / General function for the selection of item
* Let the user select an item, save its "index"
* @param owner_ptr プレーヤーへの参照ポインタ
item_selection_ptr->item = FALSE;
item_selection_ptr->i1 = 0;
item_selection_ptr->i2 = INVEN_PACK - 1;
- if (!item_selection_ptr->inven)
- item_selection_ptr->i2 = -1;
- else if (use_menu)
- for (int j = 0; j < INVEN_PACK; j++)
- if (item_tester_okay(owner_ptr, &owner_ptr->inventory_list[j], item_selection_ptr->tval) || (item_selection_ptr->mode & USE_FULL))
- item_selection_ptr->max_inven++;
-
+ test_inventory(owner_ptr, item_selection_ptr);
while ((item_selection_ptr->i1 <= item_selection_ptr->i2) && (!get_item_okay(owner_ptr, item_selection_ptr->i1, item_selection_ptr->tval)))
item_selection_ptr->i1++;