• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

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

Log Message

[Refactor] #39068 エンバグを修正しつつ,add_essence() の item_tester_tval グローバル参照をローカル引数に収める.

Change Summary

Incremental Difference

--- a/src/cmd-hissatsu.c
+++ b/src/cmd-hissatsu.c
@@ -405,12 +405,10 @@ void do_cmd_gain_hissatsu(void)
405405 msg_format("You can learn %d new special attack%s.", p_ptr->new_spells, (p_ptr->new_spells == 1?"":"s"));
406406 #endif
407407
408- item_tester_tval = TV_HISSATSU_BOOK;
409-
410408 q = _("どの書から学びますか? ", "Study which book? ");
411409 s = _("読める書がない。", "You have no books that you can read.");
412410
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);
414412 if (!o_ptr) return;
415413
416414 for (i = o_ptr->sval * 8; i < o_ptr->sval * 8 + 8; i++)
--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -65,7 +65,7 @@ void do_cmd_inven(void)
6565 screen_save();
6666
6767 /* Display the p_ptr->inventory_list */
68- (void)show_inven(0, USE_FULL, item_tester_tval);
68+ (void)show_inven(0, USE_FULL, 0);
6969
7070 #ifdef JP
7171 sprintf(out_val, "持ち物: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
@@ -117,7 +117,7 @@ void do_cmd_equip(void)
117117 if (easy_floor) command_wrk = (USE_EQUIP);
118118 screen_save();
119119
120- (void)show_equip(0, USE_FULL, item_tester_tval);
120+ (void)show_equip(0, USE_FULL, 0);
121121
122122 /* Build a prompt */
123123 #ifdef JP
--- a/src/cmd-smith.c
+++ b/src/cmd-smith.c
@@ -865,7 +865,7 @@ static void add_essence(ESSENCE_IDX mode)
865865 int use_essence;
866866 essence_type *es_ptr;
867867 bool able[22] = { 0 };
868-
868+ OBJECT_TYPE_VALUE tval = 0;
869869 int menu_line = (use_menu ? 1 : 0);
870870
871871 for (i = 0; essence_info[i].add_name; i++)
@@ -1107,7 +1107,7 @@ static void add_essence(ESSENCE_IDX mode)
11071107 es_ptr = &essence_info[num[i]];
11081108
11091109 if (es_ptr->add == ESSENCE_SLAY_GLOVE)
1110- item_tester_tval = TV_GLOVES;
1110+ tval = TV_GLOVES;
11111111 else if (mode == 1 || mode == 5)
11121112 item_tester_hook = item_tester_hook_melee_ammo;
11131113 else if (es_ptr->add == ESSENCE_ATTACK)
@@ -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), 0);
1123+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), tval);
11241124 if (!o_ptr) return;
11251125
11261126 if ((mode != 10) && (object_is_artifact(o_ptr) || object_is_smith(o_ptr)))
--- 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)), 0);
673+ o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | (p_ptr->pclass == CLASS_FORCETRAINER ? USE_FORCE : 0)), item_tester_tval);
674674 if (!o_ptr)
675675 {
676676 if (item == INVEN_FORCE) /* the_force */
--- a/src/cmd-usestaff.c
+++ b/src/cmd-usestaff.c
@@ -444,13 +444,9 @@ void do_cmd_use_staff(void)
444444 set_action(ACTION_NONE);
445445 }
446446
447- /* Restrict choices to wands */
448- item_tester_tval = TV_STAFF;
449-
450447 q = _("どの杖を使いますか? ", "Use which staff? ");
451448 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;
454450
455451 do_cmd_use_staff_aux(item);
456452 }
Show on old repository browser