• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision4b7d19ddee357a0c59713db46f36686cb1e6b92b (tree)
Time2019-08-15 23:08:27
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 choose_object() に player_type * 引数を追加し宣言を player-inventory.h に移動.

Change Summary

Incremental Difference

--- a/src/autopick.c
+++ b/src/autopick.c
@@ -24,6 +24,7 @@
2424 #include "player-move.h"
2525 #include "player-class.h"
2626 #include "player-race.h"
27+#include "player-inventory.h"
2728 #include "objectkind.h"
2829 #include "object-ego.h"
2930 #include "object-flavor.h"
@@ -3257,7 +3258,7 @@ static bool entry_from_choosed_object(autopick_type *entry)
32573258
32583259 q = _("どのアイテムを登録しますか? ", "Enter which item? ");
32593260 s = _("アイテムを持っていない。", "You have nothing to enter.");
3260- o_ptr = choose_object(NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
3261+ o_ptr = choose_object(p_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
32613262 if (!o_ptr) return FALSE;
32623263
32633264 autopick_entry_from_object(entry, o_ptr);
@@ -3276,7 +3277,7 @@ static byte get_object_for_search(object_type **o_handle, concptr *search_strp)
32763277
32773278 q = _("どのアイテムを検索しますか? ", "Enter which item? ");
32783279 s = _("アイテムを持っていない。", "You have nothing to enter.");
3279- o_ptr = choose_object(NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
3280+ o_ptr = choose_object(p_ptr, NULL, q, s, USE_INVEN | USE_FLOOR | USE_EQUIP, 0);
32803281 if (!o_ptr) return 0;
32813282
32823283 *o_handle = o_ptr;
--- a/src/bldg.c
+++ b/src/bldg.c
@@ -53,6 +53,7 @@
5353 #include "player-effects.h"
5454 #include "player-class.h"
5555 #include "player-personality.h"
56+#include "player-inventory.h"
5657 #include "scores.h"
5758 #include "shoot.h"
5859 #include "view-mainwindow.h"
@@ -2661,7 +2662,7 @@ static PRICE compare_weapons(PRICE bcost)
26612662 q = _("第一の武器は?", "What is your first weapon? ");
26622663 s = _("比べるものがありません。", "You have nothing to compare.");
26632664
2664- o_ptr[0] = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
2665+ o_ptr[0] = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
26652666 if (!o_ptr[0])
26662667 {
26672668 screen_load();
@@ -2732,7 +2733,7 @@ static PRICE compare_weapons(PRICE bcost)
27322733 s = _("比べるものがありません。", "You have nothing to compare.");
27332734
27342735 /* Get the second weapon */
2735- o_ptr[1] = choose_object(&item2, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
2736+ o_ptr[1] = choose_object(p_ptr, &item2, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
27362737 if (!o_ptr[1]) continue;
27372738
27382739 total += cost;
@@ -2922,7 +2923,7 @@ static PRICE repair_broken_weapon_aux(PRICE bcost)
29222923 /* Only forge broken weapons */
29232924 item_tester_hook = item_tester_hook_broken_weapon;
29242925
2925- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_EQUIP), 0);
2926+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_EQUIP), 0);
29262927 if (!o_ptr) return (0);
29272928
29282929 /* It is worthless */
@@ -2949,7 +2950,7 @@ static PRICE repair_broken_weapon_aux(PRICE bcost)
29492950 /* Only forge broken weapons */
29502951 item_tester_hook = item_tester_hook_orthodox_melee_weapons;
29512952
2952- mo_ptr = choose_object(&mater, q, s, (USE_INVEN | USE_EQUIP), 0);
2953+ mo_ptr = choose_object(p_ptr, &mater, q, s, (USE_INVEN | USE_EQUIP), 0);
29532954 if (!mo_ptr) return (0);
29542955 if (mater == item)
29552956 {
@@ -3185,7 +3186,7 @@ static bool enchant_item(PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_C
31853186 q = _("どのアイテムを改良しますか?", "Improve which item? ");
31863187 s = _("改良できるものがありません。", "You have nothing to improve.");
31873188
3188- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_EQUIP | IGNORE_BOTHHAND_SLOT), item_tester_tval);
3189+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_EQUIP | IGNORE_BOTHHAND_SLOT), item_tester_tval);
31893190 if (!o_ptr) return (FALSE);
31903191
31913192 /* Check if the player has enough money */
@@ -3298,7 +3299,7 @@ static void building_recharge(void)
32983299 q = _("どのアイテムに魔力を充填しますか? ", "Recharge which item? ");
32993300 s = _("魔力を充填すべきアイテムがない。", "You have nothing to recharge.");
33003301
3301- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
3302+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
33023303 if (!o_ptr) return;
33033304
33043305 k_ptr = &k_info[o_ptr->k_idx];
--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -26,6 +26,7 @@
2626 #include "realm-hex.h"
2727 #include "player-status.h"
2828 #include "player-damage.h"
29+#include "player-inventory.h"
2930 #include "monster-status.h"
3031 #include "files.h"
3132 #include "objectkind.h"
@@ -637,7 +638,7 @@ void do_cmd_activate(player_type *user_ptr)
637638 q = _("どのアイテムを始動させますか? ", "Activate which item? ");
638639 s = _("始動できるアイテムを装備していない。", "You have nothing to activate.");
639640
640- if (!choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
641+ if (!choose_object(p_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
641642
642643 /* Activate the item */
643644 exe_activate(user_ptr, item);
--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -42,6 +42,7 @@
4242 #include "player-effects.h"
4343 #include "player-class.h"
4444 #include "player-personality.h"
45+#include "player-inventory.h"
4546 #include "objectkind.h"
4647 #include "object-broken.h"
4748 #include "object-flavor.h"
@@ -2286,7 +2287,7 @@ void do_cmd_fire(player_type *creature_ptr, SPELL_IDX snipe_type)
22862287 q = _("どれを撃ちますか? ", "Fire which item? ");
22872288 s = _("発射されるアイテムがありません。", "You have nothing to fire.");
22882289
2289- ammo_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), creature_ptr->tval_ammo);
2290+ ammo_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), creature_ptr->tval_ammo);
22902291 if (!ammo_ptr)
22912292 {
22922293 flush();
@@ -2377,7 +2378,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
23772378 item_tester_hook = item_tester_hook_boomerang;
23782379 q = _("どの武器を投げますか? ", "Throw which item? ");
23792380 s = _("投げる武器がない。", "You have nothing to throw.");
2380- o_ptr = choose_object(&item, q, s, (USE_EQUIP), 0);
2381+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP), 0);
23812382 if (!o_ptr)
23822383 {
23832384 flush();
@@ -2399,7 +2400,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
23992400 {
24002401 q = _("どのアイテムを投げますか? ", "Throw which item? ");
24012402 s = _("投げるアイテムがない。", "You have nothing to throw.");
2402- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP), 0);
2403+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP), 0);
24032404 if (!o_ptr)
24042405 {
24052406 flush();
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -20,6 +20,7 @@
2020 #include "player-damage.h"
2121 #include "player-race.h"
2222 #include "player-class.h"
23+#include "player-inventory.h"
2324 #include "floor.h"
2425 #include "objectkind.h"
2526 #include "realm.h"
@@ -496,7 +497,7 @@ void do_cmd_eat_food(player_type *creature_ptr)
496497 q = _("どれを食べますか? ", "Eat which item? ");
497498 s = _("食べ物がない。", "You have nothing to eat.");
498499
499- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0)) return;
500+ if (!choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0)) return;
500501
501502 exe_eat_food(creature_ptr, item);
502503 }
--- a/src/cmd-hissatsu.c
+++ b/src/cmd-hissatsu.c
@@ -17,6 +17,7 @@
1717 #include "monsterrace-hook.h"
1818 #include "player-status.h"
1919 #include "player-effects.h"
20+#include "player-inventory.h"
2021 #include "spells.h"
2122
2223 #include "cmd-basic.h"
@@ -400,7 +401,7 @@ void do_cmd_gain_hissatsu(player_type *creature_ptr)
400401 q = _("どの書から学びますか? ", "Study which book? ");
401402 s = _("読める書がない。", "You have no books that you can read.");
402403
403- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_HISSATSU_BOOK);
404+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_HISSATSU_BOOK);
404405 if (!o_ptr) return;
405406
406407 for (i = o_ptr->sval * 8; i < o_ptr->sval * 8 + 8; i++)
--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -163,7 +163,7 @@ void do_cmd_wield(player_type *creature_ptr)
163163 q = _("どれを装備しますか? ", "Wear/Wield which item? ");
164164 s = _("装備可能なアイテムがない。", "You have nothing you can wear or wield.");
165165
166- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
166+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
167167 if (!o_ptr) return;
168168
169169 /* Check the slot */
@@ -184,7 +184,7 @@ void do_cmd_wield(player_type *creature_ptr)
184184 /* Choose a weapon from the equipment only */
185185 q = _("どちらの武器と取り替えますか?", "Replace which weapon? ");
186186 s = _("おっと。", "Oops.");
187- if (!choose_object(&slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
187+ if (!choose_object(p_ptr, &slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0)) return;
188188 if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM;
189189 }
190190
@@ -200,7 +200,7 @@ void do_cmd_wield(player_type *creature_ptr)
200200 /* Choose a hand */
201201 q = _("どちらの手に装備しますか?", "Equip which hand? ");
202202 s = _("おっと。", "Oops.");
203- if (!choose_object(&slot, q, s, (USE_EQUIP), 0)) return;
203+ if (!choose_object(p_ptr, &slot, q, s, (USE_EQUIP), 0)) return;
204204 }
205205 break;
206206
@@ -230,7 +230,7 @@ void do_cmd_wield(player_type *creature_ptr)
230230 q = _("どちらの手に装備しますか?", "Equip which hand? ");
231231 s = _("おっと。", "Oops.");
232232
233- if (!choose_object(&slot, q, s, (USE_EQUIP), 0)) return;
233+ if (!choose_object(p_ptr, &slot, q, s, (USE_EQUIP), 0)) return;
234234 if ((slot == INVEN_LARM) && !has_melee_weapon(creature_ptr, INVEN_RARM))
235235 need_switch_wielding = INVEN_RARM;
236236 }
@@ -252,7 +252,7 @@ void do_cmd_wield(player_type *creature_ptr)
252252 /* Restrict the choices */
253253 select_ring_slot = TRUE;
254254
255- if (!choose_object(&slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0))
255+ if (!choose_object(p_ptr, &slot, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0))
256256 {
257257 select_ring_slot = FALSE;
258258 return;
@@ -510,7 +510,7 @@ void do_cmd_takeoff(player_type *creature_ptr)
510510 q = _("どれを装備からはずしますか? ", "Take off which item? ");
511511 s = _("はずせる装備がない。", "You are not wearing anything to take off.");
512512
513- o_ptr = choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0);
513+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0);
514514 if (!o_ptr) return;
515515
516516 /* Item is cursed */
@@ -575,7 +575,7 @@ void do_cmd_drop(player_type *creature_ptr)
575575 q = _("どのアイテムを落としますか? ", "Drop which item? ");
576576 s = _("落とせるアイテムを持っていない。", "You have nothing to drop.");
577577
578- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
578+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0);
579579 if (!o_ptr) return;
580580
581581 /* Hack -- Cannot remove cursed items */
@@ -638,7 +638,7 @@ void do_cmd_destroy(player_type *creature_ptr)
638638 q = _("どのアイテムを壊しますか? ", "Destroy which item? ");
639639 s = _("壊せるアイテムを持っていない。", "You have nothing to destroy.");
640640
641- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
641+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
642642 if (!o_ptr) return;
643643
644644 /* Verify unless quantity given beforehand */
@@ -815,7 +815,7 @@ void do_cmd_observe(void)
815815 q = _("どのアイテムを調べますか? ", "Examine which item? ");
816816 s = _("調べられるアイテムがない。", "You have nothing to examine.");
817817
818- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
818+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
819819 if (!o_ptr) return;
820820
821821 /* Require full knowledge */
@@ -846,7 +846,7 @@ void do_cmd_uninscribe(void)
846846 q = _("どのアイテムの銘を消しますか? ", "Un-inscribe which item? ");
847847 s = _("銘を消せるアイテムがない。", "You have nothing to un-inscribe.");
848848
849- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
849+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
850850 if (!o_ptr) return;
851851
852852 /* Nothing to remove */
@@ -885,7 +885,7 @@ void do_cmd_inscribe(void)
885885 q = _("どのアイテムに銘を刻みますか? ", "Inscribe which item? ");
886886 s = _("銘を刻めるアイテムがない。", "You have nothing to inscribe.");
887887
888- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
888+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
889889 if (!o_ptr) return;
890890
891891 /* Describe the activity */
@@ -936,7 +936,7 @@ static void do_cmd_refill_lamp(void)
936936 q = _("どの油つぼから注ぎますか? ", "Refill with which flask? ");
937937 s = _("油つぼがない。", "You have no flasks of oil.");
938938
939- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
939+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
940940 if (!o_ptr) return;
941941
942942 take_turn(p_ptr, 50);
@@ -1003,7 +1003,7 @@ static void do_cmd_refill_torch(void)
10031003 q = _("どの松明で明かりを強めますか? ", "Refuel with which torch? ");
10041004 s = _("他に松明がない。", "You have no extra torches.");
10051005
1006- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
1006+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
10071007 if (!o_ptr) return;
10081008
10091009 take_turn(p_ptr, 50);
@@ -1509,7 +1509,7 @@ void do_cmd_use(void)
15091509 q = _("どれを使いますか?", "Use which item? ");
15101510 s = _("使えるものがありません。", "You have nothing to use.");
15111511
1512- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
1512+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
15131513 if (!o_ptr) return;
15141514
15151515 switch (o_ptr->tval)
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -20,6 +20,7 @@
2020 #include "player-status.h"
2121 #include "player-damage.h"
2222 #include "player-race.h"
23+#include "player-inventory.h"
2324 #include "realm-hex.h"
2425 #include "realm-song.h"
2526 #include "spells-floor.h"
@@ -609,7 +610,7 @@ void do_cmd_quaff_potion(player_type *creature_ptr)
609610 q = _("どの薬を飲みますか? ", "Quaff which potion? ");
610611 s = _("飲める薬がない。", "You have no potions to quaff.");
611612
612- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0)) return;
613+ if (!choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0)) return;
613614
614615 /* Quaff the potion */
615616 exe_quaff_potion(creature_ptr, item);
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -17,6 +17,7 @@
1717 #include "player-damage.h"
1818 #include "player-class.h"
1919 #include "player-effects.h"
20+#include "player-inventory.h"
2021 #include "rumor.h"
2122 #include "realm-hex.h"
2223
@@ -631,7 +632,7 @@ void do_cmd_read_scroll(player_type *creature_ptr)
631632 q = _("どの巻物を読みますか? ", "Read which scroll? ");
632633 s = _("読める巻物がない。", "You have no scrolls to read.");
633634
634- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
635+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
635636 if (!o_ptr) return;
636637
637638 /* Read the scroll */
--- a/src/cmd-smith.c
+++ b/src/cmd-smith.c
@@ -11,6 +11,7 @@
1111 #include "objectkind.h"
1212 #include "autopick.h"
1313 #include "view-mainwindow.h"
14+#include "player-inventory.h"
1415
1516
1617
@@ -538,7 +539,7 @@ static void drain_essence(void)
538539 q = _("どのアイテムから抽出しますか?", "Extract from which item? ");
539540 s = _("抽出できるアイテムがありません。", "You have nothing you can extract from.");
540541
541- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
542+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
542543 if (!o_ptr) return;
543544
544545 if (object_is_known(o_ptr) && !object_is_nameless(o_ptr))
@@ -1115,7 +1116,7 @@ static void add_essence(ESSENCE_IDX mode)
11151116 q = _("どのアイテムを改良しますか?", "Improve which item? ");
11161117 s = _("改良できるアイテムがありません。", "You have nothing to improve.");
11171118
1118- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), tval);
1119+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), tval);
11191120 if (!o_ptr) return;
11201121
11211122 if ((mode != 10) && (object_is_artifact(o_ptr) || object_is_smith(o_ptr)))
@@ -1334,7 +1335,7 @@ static void erase_essence(void)
13341335 q = _("どのアイテムのエッセンスを消去しますか?", "Remove from which item? ");
13351336 s = _("エッセンスを付加したアイテムがありません。", "You have nothing to remove essence.");
13361337
1337- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
1338+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
13381339 if (!o_ptr) return;
13391340
13401341 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
--- a/src/cmd-spell.c
+++ b/src/cmd-spell.c
@@ -36,6 +36,7 @@
3636 #include "player-effects.h"
3737 #include "player-skill.h"
3838 #include "player-class.h"
39+#include "player-inventory.h"
3940 #include "object-hook.h"
4041 #include "cmd-basic.h"
4142 #include "view-mainwindow.h"
@@ -667,7 +668,7 @@ void do_cmd_browse(void)
667668 q = _("どの本を読みますか? ", "Browse which book? ");
668669 s = _("読める本がない。", "You have no books that you can read.");
669670
670- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), item_tester_tval);
671+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), item_tester_tval);
671672 if (!o_ptr)
672673 {
673674 if (item == INVEN_FORCE) /* the_force */
@@ -843,7 +844,7 @@ void do_cmd_study(void)
843844 q = _("どの本から学びますか? ", "Study which book? ");
844845 s = _("読める本がない。", "You have no books that you can read.");
845846
846- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), item_tester_tval);
847+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), item_tester_tval);
847848 if (!o_ptr) return;
848849
849850 /* Access the item's sval */
@@ -1093,7 +1094,7 @@ void do_cmd_cast(void)
10931094 q = _("どの呪文書を使いますか? ", "Use which book? ");
10941095 s = _("呪文書がない!", "You have no spell books!");
10951096
1096- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), mp_ptr->spell_book);
1097+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), mp_ptr->spell_book);
10971098 if (!o_ptr)
10981099 {
10991100 if (item == INVEN_FORCE) /* the_force */
--- a/src/cmd-usestaff.c
+++ b/src/cmd-usestaff.c
@@ -7,6 +7,7 @@
77 #include "player-status.h"
88 #include "player-effects.h"
99 #include "player-class.h"
10+#include "player-inventory.h"
1011 #include "spells.h"
1112 #include "spells-status.h"
1213 #include "spells-floor.h"
@@ -433,7 +434,7 @@ void do_cmd_use_staff(player_type *creature_ptr)
433434
434435 q = _("どの杖を使いますか? ", "Use which staff? ");
435436 s = _("使える杖がない。", "You have no staff to use.");
436- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_STAFF)) return;
437+ if (!choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_STAFF)) return;
437438
438439 exe_use_staff(creature_ptr, item);
439440 }
--- a/src/cmd-zaprod.c
+++ b/src/cmd-zaprod.c
@@ -5,6 +5,7 @@
55 #include "player-status.h"
66 #include "player-effects.h"
77 #include "player-class.h"
8+#include "player-inventory.h"
89 #include "objectkind.h"
910 #include "object-hook.h"
1011 #include "spells.h"
@@ -407,7 +408,7 @@ void do_cmd_zap_rod(player_type *creature_ptr)
407408 q = _("どのロッドを振りますか? ", "Zap which rod? ");
408409 s = _("使えるロッドがない。", "You have no rod to zap.");
409410
410- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_ROD)) return;
411+ if (!choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_ROD)) return;
411412
412413 /* Zap the rod */
413414 exe_zap_rod(creature_ptr, item);
--- a/src/cmd-zapwand.c
+++ b/src/cmd-zapwand.c
@@ -7,6 +7,7 @@
77 #include "player-status.h"
88 #include "player-effects.h"
99 #include "player-class.h"
10+#include "player-inventory.h"
1011 #include "objectkind.h"
1112 #include "object-hook.h"
1213 #include "cmd-basic.h"
@@ -458,7 +459,7 @@ void do_cmd_aim_wand(player_type *creature_ptr)
458459
459460 q = _("どの魔法棒で狙いますか? ", "Aim which wand? ");
460461 s = _("使える魔法棒がない。", "You have no wand to aim.");
461- if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_WAND)) return;
462+ if (!choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), TV_WAND)) return;
462463
463464 exe_aim_wand(creature_ptr, item);
464465 }
--- a/src/object.h
+++ b/src/object.h
@@ -426,8 +426,6 @@ extern bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode, O
426426
427427 #define REF_ITEM(P_PTR, FLOOR_PTR, ID) ((ID > 0 ? &(P_PTR)->inventory_list[ID] : &(FLOOR_PTR)->o_list[0 - item]))
428428
429-extern object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, OBJECT_TYPE_VALUE tval);
430-
431429 extern int bow_tval_ammo(object_type *o_ptr);
432430
433431 /* object2.c */
--- a/src/player-inventory.c
+++ b/src/player-inventory.c
@@ -1624,13 +1624,13 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode, OBJECT_T
16241624 /*
16251625 * Choose an item and get auto-picker entry from it.
16261626 */
1627-object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, OBJECT_TYPE_VALUE tval)
1627+object_type *choose_object(player_type *creature_ptr, OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, OBJECT_TYPE_VALUE tval)
16281628 {
16291629 OBJECT_IDX item;
16301630 if (!get_item(&item, q, s, option, tval)) return NULL;
16311631 if (idx) *idx = item;
16321632 if (item == INVEN_FORCE) return NULL;
1633- return REF_ITEM(p_ptr, current_floor_ptr, item);
1633+ return REF_ITEM(creature_ptr, current_floor_ptr, item);
16341634 }
16351635
16361636
@@ -2974,7 +2974,7 @@ static bool py_pickup_floor_aux(void)
29742974 q = _("どれを拾いますか?", "Get which item? ");
29752975 s = _("もうザックには床にあるどのアイテムも入らない。", "You no longer have any room for the objects on the floor.");
29762976
2977- if (choose_object(&item, q, s, (USE_FLOOR), 0))
2977+ if (choose_object(p_ptr, &item, q, s, (USE_FLOOR), 0))
29782978 {
29792979 this_o_idx = 0 - item;
29802980 }
--- a/src/player-inventory.h
+++ b/src/player-inventory.h
@@ -11,3 +11,5 @@ extern void display_equip(OBJECT_TYPE_VALUE tval);
1111 extern COMMAND_CODE show_inven(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval);
1212 extern COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval);
1313 extern void toggle_inven_equip(player_type *creature_ptr);
14+
15+extern object_type *choose_object(player_type *creature_ptr, OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS option, OBJECT_TYPE_VALUE tval);
--- a/src/realm-hex.c
+++ b/src/realm-hex.c
@@ -29,6 +29,7 @@
2929 #include "player-status.h"
3030 #include "player-effects.h"
3131 #include "player-skill.h"
32+#include "player-inventory.h"
3233 #include "realm-hex.h"
3334 #include "grid.h"
3435 #include "monsterrace.h"
@@ -432,7 +433,7 @@ concptr do_hex_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
432433 q = _("どれを呪いますか?", "Which weapon do you curse?");
433434 s = _("武器を装備していない。", "You wield no weapons.");
434435
435- o_ptr = choose_object(&item, q, s, (USE_EQUIP), 0);
436+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP), 0);
436437 if (!o_ptr) return FALSE;
437438
438439 object_desc(o_name, o_ptr, OD_NAME_ONLY);
@@ -728,7 +729,7 @@ concptr do_hex_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
728729 q = _("どれを呪いますか?", "Which piece of armour do you curse?");
729730 s = _("防具を装備していない。", "You wield no piece of armours.");
730731
731- o_ptr = choose_object(&item, q, s, (USE_EQUIP), 0);
732+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP), 0);
732733 if (!o_ptr) return FALSE;
733734
734735 o_ptr = &caster_ptr->inventory_list[item];
@@ -935,7 +936,7 @@ concptr do_hex_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
935936 q = _("どの装備品から吸収しますか?", "Which cursed equipment do you drain mana from?");
936937 s = _("呪われたアイテムを装備していない。", "You have no cursed equipment.");
937938
938- o_ptr = choose_object(&item, q, s, (USE_EQUIP), 0);
939+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP), 0);
939940 if (!o_ptr) return FALSE;
940941
941942 object_flags(o_ptr, f);
--- a/src/spells-object.c
+++ b/src/spells-object.c
@@ -17,6 +17,7 @@
1717 #include "avatar.h"
1818 #include "player-effects.h"
1919 #include "player-class.h"
20+#include "player-inventory.h"
2021 #include "objectkind.h"
2122 #include "autopick.h"
2223 #include "targeting.h"
@@ -186,7 +187,7 @@ bool create_ammo(void)
186187
187188 q = _("どのアイテムから作りますか? ", "Convert which item? ");
188189 s = _("材料を持っていない。", "You have no item to convert.");
189- q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
190+ q_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
190191 if (!q_ptr) return FALSE;
191192
192193 q_ptr = &forge;
@@ -233,7 +234,7 @@ bool create_ammo(void)
233234 q = _("どのアイテムから作りますか? ", "Convert which item? ");
234235 s = _("材料を持っていない。", "You have no item to convert.");
235236
236- q_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
237+ q_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
237238 if (!q_ptr) return FALSE;
238239
239240 q_ptr = &forge;
@@ -290,7 +291,7 @@ bool import_magic_device(void)
290291 q = _("どのアイテムの魔力を取り込みますか? ", "Gain power of which item? ");
291292 s = _("魔力を取り込めるアイテムがない。", "You have nothing to gain power.");
292293
293- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
294+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
294295 if (!o_ptr) return (FALSE);
295296
296297 if (o_ptr->tval == TV_STAFF && o_ptr->sval == SV_STAFF_NOTHING)
@@ -747,7 +748,7 @@ bool rustproof(void)
747748 q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
748749 s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
749750
750- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
751+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
751752 if (!o_ptr) return FALSE;
752753
753754 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -961,7 +962,7 @@ bool bless_weapon(void)
961962 q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
962963 s = _("祝福できる武器がありません。", "You have weapon to bless.");
963964
964- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
965+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
965966 if (!o_ptr) return FALSE;
966967
967968 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -1107,7 +1108,7 @@ bool pulish_shield(void)
11071108 q = _("どの盾を磨きますか?", "Pulish which weapon? ");
11081109 s = _("磨く盾がありません。", "You have weapon to pulish.");
11091110
1110- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
1111+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
11111112 if (!o_ptr) return FALSE;
11121113
11131114 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -1300,7 +1301,7 @@ bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
13001301 q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
13011302 s = _("強化できるアイテムがない。", "You have nothing to enchant.");
13021303
1303- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
1304+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
13041305 if (!o_ptr) return (FALSE);
13051306
13061307 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -1351,7 +1352,7 @@ void brand_weapon(int brand_type)
13511352 q = _("どの武器を強化しますか? ", "Enchant which weapon? ");
13521353 s = _("強化できる武器がない。", "You have nothing to enchant.");
13531354
1354- o_ptr = choose_object(&item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0);
1355+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0);
13551356 if (!o_ptr) return;
13561357
13571358 /* you can never modify artifacts / ego-items */
--- a/src/spells-summon.c
+++ b/src/spells-summon.c
@@ -3,6 +3,7 @@
33
44 #include "spells.h"
55 #include "spells-summon.h"
6+#include "player-inventory.h"
67 #include "monster-status.h"
78 #include "floor.h"
89
@@ -208,7 +209,7 @@ bool cast_summon_greater_demon(void)
208209 item_tester_hook = item_tester_offer;
209210 q = _("どの死体を捧げますか? ", "Sacrifice which corpse? ");
210211 s = _("捧げられる死体を持っていない。", "You have nothing to scrifice.");
211- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
212+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
212213 if (!o_ptr) return FALSE;
213214
214215 summon_lev = plev * 2 / 3 + r_info[o_ptr->pval].level;
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -45,6 +45,7 @@
4545 #include "player-skill.h"
4646 #include "player-class.h"
4747 #include "player-damage.h"
48+#include "player-inventory.h"
4849
4950 #include "dungeon.h"
5051 #include "floor-events.h"
@@ -3950,7 +3951,7 @@ bool psychometry(void)
39503951 q = _("どのアイテムを調べますか?", "Meditate on which item? ");
39513952 s = _("調べるアイテムがありません。", "You have nothing appropriate.");
39523953
3953- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
3954+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
39543955 if (!o_ptr) return (FALSE);
39553956
39563957 /* It is fully known, no information needed */
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -1494,7 +1494,7 @@ bool alchemy(void)
14941494 q = _("どのアイテムを金に変えますか?", "Turn which item to gold? ");
14951495 s = _("金に変えられる物がありません。", "You have nothing to current_world_ptr->game_turn to gold.");
14961496
1497- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
1497+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
14981498 if (!o_ptr) return (FALSE);
14991499
15001500 /* See how many items */
@@ -1588,7 +1588,7 @@ bool artifact_scroll(void)
15881588 q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
15891589 s = _("強化できるアイテムがない。", "You have nothing to enchant.");
15901590
1591- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
1591+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
15921592 if (!o_ptr) return (FALSE);
15931593
15941594 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -1759,7 +1759,7 @@ bool ident_spell(bool only_equip)
17591759
17601760 s = _("鑑定するべきアイテムがない。", "You have nothing to identify.");
17611761
1762- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
1762+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
17631763 if (!o_ptr) return (FALSE);
17641764
17651765 old_known = identify_item(o_ptr);
@@ -1809,7 +1809,7 @@ bool mundane_spell(bool only_equip)
18091809 q = _("どれを使いますか?", "Use which item? ");
18101810 s = _("使えるものがありません。", "You have nothing you can use.");
18111811
1812- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
1812+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
18131813 if (!o_ptr) return (FALSE);
18141814
18151815 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
@@ -1875,7 +1875,7 @@ bool identify_fully(bool only_equip)
18751875
18761876 s = _("*鑑定*するべきアイテムがない。", "You have nothing to *identify*.");
18771877
1878- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
1878+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
18791879 if (!o_ptr) return (FALSE);
18801880
18811881 old_known = identify_item(o_ptr);
@@ -1952,7 +1952,7 @@ bool recharge(int power)
19521952 q = _("どのアイテムに魔力を充填しますか? ", "Recharge which item? ");
19531953 s = _("魔力を充填すべきアイテムがない。", "You have nothing to recharge.");
19541954
1955- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
1955+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
19561956 if (!o_ptr) return (FALSE);
19571957
19581958 /* Get the object kind. */
@@ -3037,7 +3037,7 @@ bool eat_magic(int power)
30373037 q = _("どのアイテムから魔力を吸収しますか?", "Drain which item? ");
30383038 s = _("魔力を吸収できるアイテムがありません。", "You have nothing to drain.");
30393039
3040- o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), 0);
3040+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
30413041 if (!o_ptr) return FALSE;
30423042
30433043 k_ptr = &k_info[o_ptr->k_idx];
--- a/src/store.c
+++ b/src/store.c
@@ -4942,7 +4942,7 @@ static void store_sell(void)
49424942 s = _("欲しい物がないですねえ。", "You have nothing that I want.");
49434943 }
49444944
4945- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
4945+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
49464946 if (!o_ptr) return;
49474947
49484948 /* Hack -- Cannot remove cursed items */
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -27,6 +27,7 @@
2727 #include "player-effects.h"
2828 #include "player-skill.h"
2929 #include "player-class.h"
30+#include "player-inventory.h"
3031
3132 #include "spells.h"
3233 #include "spells-object.h"
@@ -1136,7 +1137,7 @@ static void do_cmd_wiz_play(void)
11361137 q = "Play with which object? ";
11371138 s = "You have nothing to play with.";
11381139
1139- o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
1140+ o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
11401141
11411142 if (!o_ptr) return;
11421143
Show on old repository browser