変愚蛮怒のメインリポジトリです
Revision | 2d595001d5614b112063314f9b8fe66dc29ef553 (tree) |
---|---|
Time | 2019-06-15 16:27:58 |
Author | deskull <deskull@user...> |
Commiter | deskull |
[Refactor] #39068 エンバグを修正しつつ,add_essence() の item_tester_tval グローバル参照をローカル引数に収める.
@@ -405,12 +405,10 @@ void do_cmd_gain_hissatsu(void) | ||
405 | 405 | msg_format("You can learn %d new special attack%s.", p_ptr->new_spells, (p_ptr->new_spells == 1?"":"s")); |
406 | 406 | #endif |
407 | 407 | |
408 | - item_tester_tval = TV_HISSATSU_BOOK; | |
409 | - | |
410 | 408 | q = _("どの書から学びますか? ", "Study which book? "); |
411 | 409 | s = _("読める書がない。", "You have no books that you can read."); |
412 | 410 | |
413 | - o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), item_tester_tval); | |
411 | + o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_HISSATSU_BOOK); | |
414 | 412 | if (!o_ptr) return; |
415 | 413 | |
416 | 414 | for (i = o_ptr->sval * 8; i < o_ptr->sval * 8 + 8; i++) |
@@ -65,7 +65,7 @@ void do_cmd_inven(void) | ||
65 | 65 | screen_save(); |
66 | 66 | |
67 | 67 | /* Display the p_ptr->inventory_list */ |
68 | - (void)show_inven(0, USE_FULL, item_tester_tval); | |
68 | + (void)show_inven(0, USE_FULL, 0); | |
69 | 69 | |
70 | 70 | #ifdef JP |
71 | 71 | sprintf(out_val, "持ち物: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ", |
@@ -117,7 +117,7 @@ void do_cmd_equip(void) | ||
117 | 117 | if (easy_floor) command_wrk = (USE_EQUIP); |
118 | 118 | screen_save(); |
119 | 119 | |
120 | - (void)show_equip(0, USE_FULL, item_tester_tval); | |
120 | + (void)show_equip(0, USE_FULL, 0); | |
121 | 121 | |
122 | 122 | /* Build a prompt */ |
123 | 123 | #ifdef JP |
@@ -865,7 +865,7 @@ static void add_essence(ESSENCE_IDX mode) | ||
865 | 865 | int use_essence; |
866 | 866 | essence_type *es_ptr; |
867 | 867 | bool able[22] = { 0 }; |
868 | - | |
868 | + OBJECT_TYPE_VALUE tval = 0; | |
869 | 869 | int menu_line = (use_menu ? 1 : 0); |
870 | 870 | |
871 | 871 | for (i = 0; essence_info[i].add_name; i++) |
@@ -1107,7 +1107,7 @@ static void add_essence(ESSENCE_IDX mode) | ||
1107 | 1107 | es_ptr = &essence_info[num[i]]; |
1108 | 1108 | |
1109 | 1109 | if (es_ptr->add == ESSENCE_SLAY_GLOVE) |
1110 | - item_tester_tval = TV_GLOVES; | |
1110 | + tval = TV_GLOVES; | |
1111 | 1111 | else if (mode == 1 || mode == 5) |
1112 | 1112 | item_tester_hook = item_tester_hook_melee_ammo; |
1113 | 1113 | else if (es_ptr->add == ESSENCE_ATTACK) |
@@ -1120,7 +1120,7 @@ static void add_essence(ESSENCE_IDX mode) | ||
1120 | 1120 | q = _("どのアイテムを改良しますか?", "Improve which item? "); |
1121 | 1121 | s = _("改良できるアイテムがありません。", "You have nothing to improve."); |
1122 | 1122 | |
1123 | - o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0); | |
1123 | + o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), tval); | |
1124 | 1124 | if (!o_ptr) return; |
1125 | 1125 | |
1126 | 1126 | if ((mode != 10) && (object_is_artifact(o_ptr) || object_is_smith(o_ptr))) |
@@ -670,7 +670,7 @@ void do_cmd_browse(void) | ||
670 | 670 | q = _("どの本を読みますか? ", "Browse which book? "); |
671 | 671 | s = _("読める本がない。", "You have no books that you can read."); |
672 | 672 | |
673 | - o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), 0); | |
673 | + o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), item_tester_tval); | |
674 | 674 | if (!o_ptr) |
675 | 675 | { |
676 | 676 | if (item == INVEN_FORCE) /* the_force */ |
@@ -444,13 +444,9 @@ void do_cmd_use_staff(void) | ||
444 | 444 | set_action(ACTION_NONE); |
445 | 445 | } |
446 | 446 | |
447 | - /* Restrict choices to wands */ | |
448 | - item_tester_tval = TV_STAFF; | |
449 | - | |
450 | 447 | q = _("どの杖を使いますか? ", "Use which staff? "); |
451 | 448 | s = _("使える杖がない。", "You have no staff to use."); |
452 | - | |
453 | - if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), item_tester_tval)) return; | |
449 | + if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR), TV_STAFF)) return; | |
454 | 450 | |
455 | 451 | do_cmd_use_staff_aux(item); |
456 | 452 | } |