• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

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

Log Message

[Refactor] #39068 choose_object() の item_tester_tval グローバル参照をローカル引数に収める.(一部バグを起こしている可能性があるので要テスト)

Change Summary

Incremental Difference

--- a/src/autopick.c
+++ b/src/autopick.c
@@ -3271,7 +3271,7 @@ static bool entry_from_choosed_object(autopick_type *entry)
32713271
32723272 q = _("どのアイテムを登録しますか? ", "Enter which item? ");
32733273 s = _("アイテムを持っていない。", "You have nothing to enter.");
3274- o_ptr = choose_object(NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP);
3274+ o_ptr = choose_object(NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
32753275 if (!o_ptr) return FALSE;
32763276
32773277 autopick_entry_from_object(entry, o_ptr);
@@ -3290,7 +3290,7 @@ static byte get_object_for_search(object_type **o_handle, concptr *search_strp)
32903290
32913291 q = _("どのアイテムを検索しますか? ", "Enter which item? ");
32923292 s = _("アイテムを持っていない。", "You have nothing to enter.");
3293- o_ptr = choose_object(NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP);
3293+ o_ptr = choose_object(NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
32943294 if (!o_ptr) return 0;
32953295
32963296 *o_handle = o_ptr;
--- a/src/bldg.c
+++ b/src/bldg.c
@@ -2660,7 +2660,7 @@ static PRICE compare_weapons(PRICE bcost)
26602660 q = _("第一の武器は?", "What is your first weapon? ");
26612661 s = _("比べるものがありません。", "You have nothing to compare.");
26622662
2663- o_ptr[0] = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT));
2663+ o_ptr[0] = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
26642664 if (!o_ptr[0])
26652665 {
26662666 screen_load();
@@ -2731,7 +2731,7 @@ static PRICE compare_weapons(PRICE bcost)
27312731 s = _("比べるものがありません。", "You have nothing to compare.");
27322732
27332733 /* Get the second weapon */
2734- o_ptr[1] = choose_object(&item2, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT));
2734+ o_ptr[1] = choose_object(&item2, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
27352735 if (!o_ptr[1]) continue;
27362736
27372737 total += cost;
@@ -2921,7 +2921,7 @@ static PRICE repair_broken_weapon_aux(PRICE bcost)
29212921 /* Only forge broken weapons */
29222922 item_tester_hook = item_tester_hook_broken_weapon;
29232923
2924- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_EQUIP));
2924+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_EQUIP), item_tester_tval);
29252925 if (!o_ptr) return (0);
29262926
29272927 /* It is worthless */
@@ -2948,7 +2948,7 @@ static PRICE repair_broken_weapon_aux(PRICE bcost)
29482948 /* Only forge broken weapons */
29492949 item_tester_hook = item_tester_hook_orthodox_melee_weapons;
29502950
2951- mo_ptr = choose_object(&mater, q, s, (USE_INVEN | USE_EQUIP));
2951+ mo_ptr = choose_object(&mater, q, s, (USE_INVEN | USE_EQUIP), 0);
29522952 if (!mo_ptr) return (0);
29532953 if (mater == item)
29542954 {
@@ -3184,7 +3184,7 @@ static bool enchant_item(PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_C
31843184 q = _("どのアイテムを改良しますか?", "Improve which item? ");
31853185 s = _("改良できるものがありません。", "You have nothing to improve.");
31863186
3187- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_EQUIP | IGNORE_BOTHHAND_SLOT));
3187+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_EQUIP | IGNORE_BOTHHAND_SLOT), item_tester_tval);
31883188 if (!o_ptr) return (FALSE);
31893189
31903190 /* Check if the player has enough money */
@@ -3297,7 +3297,7 @@ static void building_recharge(void)
32973297 q = _("どのアイテムに魔力を充填しますか? ", "Recharge which item? ");
32983298 s = _("魔力を充填すべきアイテムがない。", "You have nothing to recharge.");
32993299
3300- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
3300+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
33013301 if (!o_ptr) return;
33023302
33033303 k_ptr = &k_info[o_ptr->k_idx];
--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -650,7 +650,7 @@ void do_cmd_activate(void)
650650 q = _("どのアイテムを始動させますか? ", "Activate which item? ");
651651 s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
652652
653- if (!choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT))) return;
653+ if (!choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
654654
655655 /* Activate the item */
656656 do_cmd_activate_aux(item);
--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -2303,14 +2303,10 @@ void do_cmd_fire(SPELL_IDX snipe_type)
23032303 set_action(ACTION_NONE);
23042304 }
23052305
2306- /* Require proper missile */
2307- item_tester_tval = p_ptr->tval_ammo;
2308-
23092306 q = _("どれを撃ちますか? ", "Fire which item? ");
23102307 s = _("発射されるアイテムがありません。", "You have nothing to fire.");
23112308
2312-
2313- ammo_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
2309+ ammo_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), p_ptr->tval_ammo);
23142310 if (!ammo_ptr)
23152311 {
23162312 flush();
@@ -2401,7 +2397,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
24012397 item_tester_hook = item_tester_hook_boomerang;
24022398 q = _("どの武器を投げますか? ", "Throw which item? ");
24032399 s = _("投げる武器がない。", "You have nothing to throw.");
2404- o_ptr = choose_object(&item, q, s, (USE_EQUIP));
2400+ o_ptr = choose_object(&item, q, s, (USE_EQUIP), 0);
24052401 if (!o_ptr)
24062402 {
24072403 flush();
@@ -2423,7 +2419,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
24232419 {
24242420 q = _("どのアイテムを投げますか? ", "Throw which item? ");
24252421 s = _("投げるアイテムがない。", "You have nothing to throw.");
2426- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP));
2422+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP), 0);
24272423 if (!o_ptr)
24282424 {
24292425 flush();
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -521,7 +521,7 @@ void do_cmd_eat_food(void)
521521 q = _("どれを食べますか? ", "Eat which item? ");
522522 s = _("食べ物がない。", "You have nothing to eat.");
523523
524- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
524+ if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0)) return;
525525
526526 /* Eat the object */
527527 do_cmd_eat_food_aux(item);
--- a/src/cmd-hissatsu.c
+++ b/src/cmd-hissatsu.c
@@ -410,7 +410,7 @@ void do_cmd_gain_hissatsu(void)
410410 q = _("どの書から学びますか? ", "Study which book? ");
411411 s = _("読める書がない。", "You have no books that you can read.");
412412
413- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
413+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), item_tester_tval);
414414 if (!o_ptr) return;
415415
416416 for (i = o_ptr->sval * 8; i < o_ptr->sval * 8 + 8; i++)
--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -189,7 +189,7 @@ void do_cmd_wield(void)
189189 q = _("どれを装備しますか? ", "Wear/Wield which item? ");
190190 s = _("装備可能なアイテムがない。", "You have nothing you can wear or wield.");
191191
192- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
192+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
193193 if (!o_ptr) return;
194194
195195 /* Check the slot */
@@ -210,7 +210,7 @@ void do_cmd_wield(void)
210210 /* Choose a weapon from the equipment only */
211211 q = _("どちらの武器と取り替えますか?", "Replace which weapon? ");
212212 s = _("おっと。", "Oops.");
213- if (!choose_object(&slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT))) return;
213+ if (!choose_object(&slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
214214 if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM;
215215 }
216216
@@ -226,7 +226,7 @@ void do_cmd_wield(void)
226226 /* Choose a hand */
227227 q = _("どちらの手に装備しますか?", "Equip which hand? ");
228228 s = _("おっと。", "Oops.");
229- if (!choose_object(&slot, q, s, (USE_EQUIP))) return;
229+ if (!choose_object(&slot, q, s, (USE_EQUIP), 0)) return;
230230 }
231231 break;
232232
@@ -256,7 +256,7 @@ void do_cmd_wield(void)
256256 q = _("どちらの手に装備しますか?", "Equip which hand? ");
257257 s = _("おっと。", "Oops.");
258258
259- if (!choose_object(&slot, q, s, (USE_EQUIP))) return;
259+ if (!choose_object(&slot, q, s, (USE_EQUIP), 0)) return;
260260 if ((slot == INVEN_LARM) && !has_melee_weapon(INVEN_RARM))
261261 need_switch_wielding = INVEN_RARM;
262262 }
@@ -278,7 +278,7 @@ void do_cmd_wield(void)
278278 /* Restrict the choices */
279279 select_ring_slot = TRUE;
280280
281- if (!choose_object(&slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT)))
281+ if (!choose_object(&slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0))
282282 {
283283 select_ring_slot = FALSE;
284284 return;
@@ -539,7 +539,7 @@ void do_cmd_takeoff(void)
539539 q = _("どれを装備からはずしますか? ", "Take off which item? ");
540540 s = _("はずせる装備がない。", "You are not wearing anything to take off.");
541541
542- o_ptr = choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT));
542+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0);
543543 if (!o_ptr) return;
544544
545545 /* Item is cursed */
@@ -604,7 +604,7 @@ void do_cmd_drop(void)
604604 q = _("どのアイテムを落としますか? ", "Drop which item? ");
605605 s = _("落とせるアイテムを持っていない。", "You have nothing to drop.");
606606
607- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT));
607+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
608608 if (!o_ptr) return;
609609
610610 /* Hack -- Cannot remove cursed items */
@@ -667,7 +667,7 @@ void do_cmd_destroy(void)
667667 q = _("どのアイテムを壊しますか? ", "Destroy which item? ");
668668 s = _("壊せるアイテムを持っていない。", "You have nothing to destroy.");
669669
670- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
670+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
671671 if (!o_ptr) return;
672672
673673 /* Verify unless quantity given beforehand */
@@ -844,7 +844,7 @@ void do_cmd_observe(void)
844844 q = _("どのアイテムを調べますか? ", "Examine which item? ");
845845 s = _("調べられるアイテムがない。", "You have nothing to examine.");
846846
847- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
847+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
848848 if (!o_ptr) return;
849849
850850 /* Require full knowledge */
@@ -875,7 +875,7 @@ void do_cmd_uninscribe(void)
875875 q = _("どのアイテムの銘を消しますか? ", "Un-inscribe which item? ");
876876 s = _("銘を消せるアイテムがない。", "You have nothing to un-inscribe.");
877877
878- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
878+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
879879 if (!o_ptr) return;
880880
881881 /* Nothing to remove */
@@ -914,7 +914,7 @@ void do_cmd_inscribe(void)
914914 q = _("どのアイテムに銘を刻みますか? ", "Inscribe which item? ");
915915 s = _("銘を刻めるアイテムがない。", "You have nothing to inscribe.");
916916
917- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
917+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
918918 if (!o_ptr) return;
919919
920920 /* Describe the activity */
@@ -965,7 +965,7 @@ static void do_cmd_refill_lamp(void)
965965 q = _("どの油つぼから注ぎますか? ", "Refill with which flask? ");
966966 s = _("油つぼがない。", "You have no flasks of oil.");
967967
968- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
968+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
969969 if (!o_ptr) return;
970970
971971 take_turn(p_ptr, 50);
@@ -1032,7 +1032,7 @@ static void do_cmd_refill_torch(void)
10321032 q = _("どの松明で明かりを強めますか? ", "Refuel with which torch? ");
10331033 s = _("他に松明がない。", "You have no extra torches.");
10341034
1035- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
1035+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
10361036 if (!o_ptr) return;
10371037
10381038 take_turn(p_ptr, 50);
@@ -1541,7 +1541,7 @@ void do_cmd_use(void)
15411541 q = _("どれを使いますか?", "Use which item? ");
15421542 s = _("使えるものがありません。", "You have nothing to use.");
15431543
1544- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1544+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
15451545 if (!o_ptr) return;
15461546
15471547 switch (o_ptr->tval)
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -619,7 +619,7 @@ void do_cmd_quaff_potion(void)
619619 q = _("どの薬を飲みますか? ", "Quaff which potion? ");
620620 s = _("飲める薬がない。", "You have no potions to quaff.");
621621
622- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
622+ if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0)) return;
623623
624624 /* Quaff the potion */
625625 do_cmd_quaff_potion_aux(item);
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -646,7 +646,7 @@ void do_cmd_read_scroll(void)
646646 q = _("どの巻物を読みますか? ", "Read which scroll? ");
647647 s = _("読める巻物がない。", "You have no scrolls to read.");
648648
649- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
649+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
650650 if (!o_ptr) return;
651651
652652 /* Read the scroll */
--- a/src/cmd-smith.c
+++ b/src/cmd-smith.c
@@ -538,7 +538,7 @@ static void drain_essence(void)
538538 q = _("どのアイテムから抽出しますか?", "Extract from which item? ");
539539 s = _("抽出できるアイテムがありません。", "You have nothing you can extract from.");
540540
541- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
541+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
542542 if (!o_ptr) return;
543543
544544 if (object_is_known(o_ptr) && !object_is_nameless(o_ptr))
@@ -1120,7 +1120,7 @@ static void add_essence(ESSENCE_IDX mode)
11201120 q = _("どのアイテムを改良しますか?", "Improve which item? ");
11211121 s = _("改良できるアイテムがありません。", "You have nothing to improve.");
11221122
1123- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1123+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
11241124 if (!o_ptr) return;
11251125
11261126 if ((mode != 10) && (object_is_artifact(o_ptr) || object_is_smith(o_ptr)))
@@ -1339,7 +1339,7 @@ static void erase_essence(void)
13391339 q = _("どのアイテムのエッセンスを消去しますか?", "Remove from which item? ");
13401340 s = _("エッセンスを付加したアイテムがありません。", "You have nothing to remove essence.");
13411341
1342- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
1342+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
13431343 if (!o_ptr) return;
13441344
13451345 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
--- a/src/cmd-spell.c
+++ b/src/cmd-spell.c
@@ -670,7 +670,7 @@ void do_cmd_browse(void)
670670 q = _("どの本を読みますか? ", "Browse which book? ");
671671 s = _("読める本がない。", "You have no books that you can read.");
672672
673- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)));
673+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), 0);
674674 if (!o_ptr)
675675 {
676676 if (item == INVEN_FORCE) /* the_force */
@@ -854,7 +854,7 @@ void do_cmd_study(void)
854854 q = _("どの本から学びますか? ", "Study which book? ");
855855 s = _("読める本がない。", "You have no books that you can read.");
856856
857- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
857+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), item_tester_tval);
858858 if (!o_ptr) return;
859859
860860 /* Access the item's sval */
@@ -1104,13 +1104,10 @@ void do_cmd_cast(void)
11041104
11051105 prayer = spell_category_name(mp_ptr->spell_book);
11061106
1107- /* Restrict choices to spell books */
1108- item_tester_tval = mp_ptr->spell_book;
1109-
11101107 q = _("どの呪文書を使いますか? ", "Use which book? ");
11111108 s = _("呪文書がない!", "You have no spell books!");
11121109
1113- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)));
1110+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), mp_ptr->spell_book);
11141111 if (!o_ptr)
11151112 {
11161113 if (item == INVEN_FORCE) /* the_force */
--- a/src/cmd-usestaff.c
+++ b/src/cmd-usestaff.c
@@ -450,7 +450,7 @@ void do_cmd_use_staff(void)
450450 q = _("どの杖を使いますか? ", "Use which staff? ");
451451 s = _("使える杖がない。", "You have no staff to use.");
452452
453- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
453+ if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), item_tester_tval)) return;
454454
455455 do_cmd_use_staff_aux(item);
456456 }
--- a/src/cmd-zaprod.c
+++ b/src/cmd-zaprod.c
@@ -416,13 +416,10 @@ void do_cmd_zap_rod(void)
416416 set_action(ACTION_NONE);
417417 }
418418
419- /* Restrict choices to rods */
420- item_tester_tval = TV_ROD;
421-
422419 q = _("どのロッドを振りますか? ", "Zap which rod? ");
423420 s = _("使えるロッドがない。", "You have no rod to zap.");
424421
425- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
422+ if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_ROD)) return;
426423
427424 /* Zap the rod */
428425 do_cmd_zap_rod_aux(item);
--- a/src/cmd-zapwand.c
+++ b/src/cmd-zapwand.c
@@ -461,10 +461,6 @@ void do_cmd_aim_wand(void)
461461
462462 if (p_ptr->wild_mode) return;
463463 if (cmd_limit_arena(p_ptr)) return;
464-
465- /* Restrict choices to wands */
466- item_tester_tval = TV_WAND;
467-
468464 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
469465 {
470466 set_action(ACTION_NONE);
@@ -472,7 +468,7 @@ void do_cmd_aim_wand(void)
472468
473469 q = _("どの魔法棒で狙いますか? ", "Aim which wand? ");
474470 s = _("使える魔法棒がない。", "You have no wand to aim.");
475- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
471+ if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_WAND)) return;
476472
477473 do_cmd_aim_wand_aux(item);
478474 }
--- a/src/object.h
+++ b/src/object.h
@@ -432,7 +432,7 @@ extern void toggle_inven_equip(void);
432432 #define USE_FULL 0x20 /*!< アイテム表示/選択範囲: 空欄まですべて表示する*/
433433 extern bool can_get_item(OBJECT_TYPE_VALUE tval);
434434 extern bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval);
435-extern object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option);
435+extern object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, OBJECT_TYPE_VALUE tval);
436436 PERCENTAGE breakage_chance(object_type *o_ptr, SPELL_IDX snipe_type);
437437
438438 extern int bow_tval_ammo(object_type *o_ptr);
--- a/src/player-inventory.c
+++ b/src/player-inventory.c
@@ -1563,10 +1563,10 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode, OBJECT_T
15631563 /*
15641564 * Choose an item and get auto-picker entry from it.
15651565 */
1566-object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option)
1566+object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, OBJECT_TYPE_VALUE tval)
15671567 {
15681568 OBJECT_IDX item;
1569- if (!get_item(&item, q, s, option, item_tester_tval)) return NULL;
1569+ if (!get_item(&item, q, s, option, tval)) return NULL;
15701570 if (idx) *idx = item;
15711571
15721572 if (item == INVEN_FORCE) return NULL;
@@ -2923,7 +2923,7 @@ static bool py_pickup_floor_aux(void)
29232923 q = _("どれを拾いますか?", "Get which item? ");
29242924 s = _("もうザックには床にあるどのアイテムも入らない。", "You no longer have any room for the objects on the floor.");
29252925
2926- if (choose_object(&item, q, s, (USE_FLOOR)))
2926+ if (choose_object(&item, q, s, (USE_FLOOR), 0))
29272927 {
29282928 this_o_idx = 0 - item;
29292929 }
--- a/src/realm-hex.c
+++ b/src/realm-hex.c
@@ -432,7 +432,7 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
432432 q = _("どれを呪いますか?", "Which weapon do you curse?");
433433 s = _("武器を装備していない。", "You wield no weapons.");
434434
435- o_ptr = choose_object(&item, q, s, (USE_EQUIP));
435+ o_ptr = choose_object(&item, q, s, (USE_EQUIP), 0);
436436 if (!o_ptr) return FALSE;
437437
438438 object_desc(o_name, o_ptr, OD_NAME_ONLY);
@@ -728,7 +728,7 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
728728 q = _("どれを呪いますか?", "Which piece of armour do you curse?");
729729 s = _("防具を装備していない。", "You wield no piece of armours.");
730730
731- o_ptr = choose_object(&item, q, s, (USE_EQUIP));
731+ o_ptr = choose_object(&item, q, s, (USE_EQUIP), 0);
732732 if (!o_ptr) return FALSE;
733733
734734 o_ptr = &p_ptr->inventory_list[item];
@@ -935,7 +935,7 @@ concptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
935935 q = _("どの装備品から吸収しますか?", "Which cursed equipment do you drain mana from?");
936936 s = _("呪われたアイテムを装備していない。", "You have no cursed equipment.");
937937
938- o_ptr = choose_object(&item, q, s, (USE_EQUIP));
938+ o_ptr = choose_object(&item, q, s, (USE_EQUIP), 0);
939939 if (!o_ptr) return FALSE;
940940
941941 object_flags(o_ptr, f);
--- a/src/spells-object.c
+++ b/src/spells-object.c
@@ -178,7 +178,7 @@ bool create_ammo(void)
178178
179179 q = _("どのアイテムから作りますか? ", "Convert which item? ");
180180 s = _("材料を持っていない。", "You have no item to convert.");
181- q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
181+ q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
182182 if (!q_ptr) return FALSE;
183183
184184 q_ptr = &forge;
@@ -225,7 +225,7 @@ bool create_ammo(void)
225225 q = _("どのアイテムから作りますか? ", "Convert which item? ");
226226 s = _("材料を持っていない。", "You have no item to convert.");
227227
228- q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
228+ q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
229229 if (!q_ptr) return FALSE;
230230
231231 q_ptr = &forge;
@@ -282,7 +282,7 @@ bool import_magic_device(void)
282282 q = _("どのアイテムの魔力を取り込みますか? ", "Gain power of which item? ");
283283 s = _("魔力を取り込めるアイテムがない。", "You have nothing to gain power.");
284284
285- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
285+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
286286 if (!o_ptr) return (FALSE);
287287
288288 if (o_ptr->tval == TV_STAFF && o_ptr->sval == SV_STAFF_NOTHING)
@@ -739,7 +739,7 @@ bool rustproof(void)
739739 q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
740740 s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
741741
742- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
742+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
743743 if (!o_ptr) return FALSE;
744744
745745 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -953,7 +953,7 @@ bool bless_weapon(void)
953953 q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
954954 s = _("祝福できる武器がありません。", "You have weapon to bless.");
955955
956- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
956+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
957957 if (!o_ptr) return FALSE;
958958
959959 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -1099,7 +1099,7 @@ bool pulish_shield(void)
10991099 q = _("どの盾を磨きますか?", "Pulish which weapon? ");
11001100 s = _("磨く盾がありません。", "You have weapon to pulish.");
11011101
1102- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1102+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
11031103 if (!o_ptr) return FALSE;
11041104
11051105 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
--- a/src/spells-summon.c
+++ b/src/spells-summon.c
@@ -208,7 +208,7 @@ bool cast_summon_greater_demon(void)
208208 item_tester_hook = item_tester_offer;
209209 q = _("どの死体を捧げますか? ", "Sacrifice which corpse? ");
210210 s = _("捧げられる死体を持っていない。", "You have nothing to scrifice.");
211- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
211+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
212212 if (!o_ptr) return FALSE;
213213
214214 summon_lev = plev * 2 / 3 + r_info[o_ptr->pval].level;
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -3950,7 +3950,7 @@ bool psychometry(void)
39503950 q = _("どのアイテムを調べますか?", "Meditate on which item? ");
39513951 s = _("調べるアイテムがありません。", "You have nothing appropriate.");
39523952
3953- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
3953+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
39543954 if (!o_ptr) return (FALSE);
39553955
39563956 /* It is fully known, no information needed */
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -1042,7 +1042,7 @@ void brand_weapon(int brand_type)
10421042 q = _("どの武器を強化しますか? ", "Enchant which weapon? ");
10431043 s = _("強化できる武器がない。", "You have nothing to enchant.");
10441044
1045- o_ptr = choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT));
1045+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0);
10461046 if (!o_ptr) return;
10471047
10481048 /* you can never modify artifacts / ego-items */
@@ -1653,7 +1653,7 @@ bool alchemy(void)
16531653 q = _("どのアイテムを金に変えますか?", "Turn which item to gold? ");
16541654 s = _("金に変えられる物がありません。", "You have nothing to current_world_ptr->game_turn to gold.");
16551655
1656- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
1656+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
16571657 if (!o_ptr) return (FALSE);
16581658
16591659 /* See how many items */
@@ -1889,7 +1889,7 @@ bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
18891889 q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
18901890 s = _("強化できるアイテムがない。", "You have nothing to enchant.");
18911891
1892- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1892+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
18931893 if (!o_ptr) return (FALSE);
18941894
18951895 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -1939,7 +1939,7 @@ bool artifact_scroll(void)
19391939 q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
19401940 s = _("強化できるアイテムがない。", "You have nothing to enchant.");
19411941
1942- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1942+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
19431943 if (!o_ptr) return (FALSE);
19441944
19451945 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -2110,7 +2110,7 @@ bool ident_spell(bool only_equip)
21102110
21112111 s = _("鑑定するべきアイテムがない。", "You have nothing to identify.");
21122112
2113- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
2113+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
21142114 if (!o_ptr) return (FALSE);
21152115
21162116 old_known = identify_item(o_ptr);
@@ -2160,7 +2160,7 @@ bool mundane_spell(bool only_equip)
21602160 q = _("どれを使いますか?", "Use which item? ");
21612161 s = _("使えるものがありません。", "You have nothing you can use.");
21622162
2163- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
2163+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
21642164 if (!o_ptr) return (FALSE);
21652165
21662166 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
@@ -2226,7 +2226,7 @@ bool identify_fully(bool only_equip)
22262226
22272227 s = _("*鑑定*するべきアイテムがない。", "You have nothing to *identify*.");
22282228
2229- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
2229+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
22302230 if (!o_ptr) return (FALSE);
22312231
22322232 old_known = identify_item(o_ptr);
@@ -2303,7 +2303,7 @@ bool recharge(int power)
23032303 q = _("どのアイテムに魔力を充填しますか? ", "Recharge which item? ");
23042304 s = _("魔力を充填すべきアイテムがない。", "You have nothing to recharge.");
23052305
2306- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
2306+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
23072307 if (!o_ptr) return (FALSE);
23082308
23092309 /* Get the object kind. */
@@ -3388,7 +3388,7 @@ bool eat_magic(int power)
33883388 q = _("どのアイテムから魔力を吸収しますか?", "Drain which item? ");
33893389 s = _("魔力を吸収できるアイテムがありません。", "You have nothing to drain.");
33903390
3391- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
3391+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
33923392 if (!o_ptr) return FALSE;
33933393
33943394 k_ptr = &k_info[o_ptr->k_idx];
--- a/src/store.c
+++ b/src/store.c
@@ -4941,7 +4941,7 @@ static void store_sell(void)
49414941 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
49424942 }
49434943
4944- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
4944+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
49454945 if (!o_ptr) return;
49464946
49474947 /* Hack -- Cannot remove cursed items */
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -1136,7 +1136,7 @@ static void do_cmd_wiz_play(void)
11361136 q = "Play with which object? ";
11371137 s = "You have nothing to play with.";
11381138
1139- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT));
1139+ o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
11401140
11411141 if (!o_ptr) return;
11421142
Show on old repository browser