From: deskull Date: Sat, 15 Jun 2019 07:26:04 +0000 (+0900) Subject: [Refactor] #39068 エンバグを修正しつつ,add_essence() の item_tester_tval グローバル参照をローカル引数に収める. X-Git-Tag: vmacos3.0.0-alpha52~3104 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2d595001d5614b112063314f9b8fe66dc29ef553;p=hengbandforosx%2Fhengbandosx.git [Refactor] #39068 エンバグを修正しつつ,add_essence() の item_tester_tval グローバル参照をローカル引数に収める. --- diff --git a/src/cmd-hissatsu.c b/src/cmd-hissatsu.c index db72e01e6..79988981d 100644 --- a/src/cmd-hissatsu.c +++ b/src/cmd-hissatsu.c @@ -405,12 +405,10 @@ void do_cmd_gain_hissatsu(void) msg_format("You can learn %d new special attack%s.", p_ptr->new_spells, (p_ptr->new_spells == 1?"":"s")); #endif - item_tester_tval = TV_HISSATSU_BOOK; - q = _("どの書から学びますか? ", "Study which book? "); s = _("読める書がない。", "You have no books that you can read."); - o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), item_tester_tval); + o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_HISSATSU_BOOK); if (!o_ptr) return; for (i = o_ptr->sval * 8; i < o_ptr->sval * 8 + 8; i++) diff --git a/src/cmd-item.c b/src/cmd-item.c index d058c73a0..a3938e7db 100644 --- a/src/cmd-item.c +++ b/src/cmd-item.c @@ -65,7 +65,7 @@ void do_cmd_inven(void) screen_save(); /* Display the p_ptr->inventory_list */ - (void)show_inven(0, USE_FULL, item_tester_tval); + (void)show_inven(0, USE_FULL, 0); #ifdef JP sprintf(out_val, "持ち物: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ", @@ -117,7 +117,7 @@ void do_cmd_equip(void) if (easy_floor) command_wrk = (USE_EQUIP); screen_save(); - (void)show_equip(0, USE_FULL, item_tester_tval); + (void)show_equip(0, USE_FULL, 0); /* Build a prompt */ #ifdef JP diff --git a/src/cmd-smith.c b/src/cmd-smith.c index cff4a2b33..ce29023fc 100644 --- a/src/cmd-smith.c +++ b/src/cmd-smith.c @@ -865,7 +865,7 @@ static void add_essence(ESSENCE_IDX mode) int use_essence; essence_type *es_ptr; bool able[22] = { 0 }; - + OBJECT_TYPE_VALUE tval = 0; int menu_line = (use_menu ? 1 : 0); for (i = 0; essence_info[i].add_name; i++) @@ -1107,7 +1107,7 @@ static void add_essence(ESSENCE_IDX mode) es_ptr = &essence_info[num[i]]; if (es_ptr->add == ESSENCE_SLAY_GLOVE) - item_tester_tval = TV_GLOVES; + tval = TV_GLOVES; else if (mode == 1 || mode == 5) item_tester_hook = item_tester_hook_melee_ammo; else if (es_ptr->add == ESSENCE_ATTACK) @@ -1120,7 +1120,7 @@ static void add_essence(ESSENCE_IDX mode) q = _("どのアイテムを改良しますか?", "Improve which item? "); s = _("改良できるアイテムがありません。", "You have nothing to improve."); - o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0); + o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), tval); if (!o_ptr) return; if ((mode != 10) && (object_is_artifact(o_ptr) || object_is_smith(o_ptr))) diff --git a/src/cmd-spell.c b/src/cmd-spell.c index 8d0f63db3..31a8260e1 100644 --- a/src/cmd-spell.c +++ b/src/cmd-spell.c @@ -670,7 +670,7 @@ void do_cmd_browse(void) q = _("どの本を読みますか? ", "Browse which book? "); s = _("読める本がない。", "You have no books that you can read."); - o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), 0); + o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), item_tester_tval); if (!o_ptr) { if (item == INVEN_FORCE) /* the_force */ diff --git a/src/cmd-usestaff.c b/src/cmd-usestaff.c index 23023bd29..e2bf41700 100644 --- a/src/cmd-usestaff.c +++ b/src/cmd-usestaff.c @@ -444,13 +444,9 @@ void do_cmd_use_staff(void) set_action(ACTION_NONE); } - /* Restrict choices to wands */ - item_tester_tval = TV_STAFF; - q = _("どの杖を使いますか? ", "Use which staff? "); s = _("使える杖がない。", "You have no staff to use."); - - if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), item_tester_tval)) return; + if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_STAFF)) return; do_cmd_use_staff_aux(item); }