• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision549327d47c2ae4e0e08c76560a339be90af41928 (tree)
Time2019-07-10 12:30:33
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 has_melee_weapon() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -2374,7 +2374,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
23742374 }
23752375 else if (boomerang)
23762376 {
2377- if (has_melee_weapon(INVEN_RARM) && has_melee_weapon(INVEN_LARM))
2377+ if (has_melee_weapon(p_ptr, INVEN_RARM) && has_melee_weapon(p_ptr, INVEN_LARM))
23782378 {
23792379 item_tester_hook = item_tester_hook_boomerang;
23802380 q = _("どの武器を投げますか? ", "Throw which item? ");
@@ -2386,7 +2386,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
23862386 return FALSE;
23872387 }
23882388 }
2389- else if (has_melee_weapon(INVEN_LARM))
2389+ else if (has_melee_weapon(p_ptr, INVEN_LARM))
23902390 {
23912391 item = INVEN_LARM;
23922392 o_ptr = &p_ptr->inventory_list[item];
--- a/src/cmd-hissatsu.c
+++ b/src/cmd-hissatsu.c
@@ -319,7 +319,7 @@ void do_cmd_hissatsu(void)
319319 magic_type spell;
320320
321321 if (cmd_limit_confused(p_ptr)) return;
322- if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
322+ if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
323323 {
324324 if (flush_failure) flush();
325325 msg_print(_("武器を持たないと必殺技は使えない!", "You need to wield a weapon!"));
--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -203,7 +203,7 @@ void do_cmd_wield(void)
203203 case TV_SHIELD:
204204 case TV_CARD:
205205 /* Dual wielding */
206- if (has_melee_weapon(INVEN_RARM) && has_melee_weapon(INVEN_LARM))
206+ if (has_melee_weapon(p_ptr, INVEN_RARM) && has_melee_weapon(p_ptr, INVEN_LARM))
207207 {
208208 /* Restrict the choices */
209209 item_tester_hook = item_tester_hook_melee_weapon;
@@ -215,7 +215,7 @@ void do_cmd_wield(void)
215215 if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM;
216216 }
217217
218- else if (has_melee_weapon(INVEN_LARM)) slot = INVEN_RARM;
218+ else if (has_melee_weapon(p_ptr, INVEN_LARM)) slot = INVEN_RARM;
219219
220220 /* Both arms are already used by non-weapon */
221221 else if (p_ptr->inventory_list[INVEN_RARM].k_idx && !object_is_melee_weapon(&p_ptr->inventory_list[INVEN_RARM]) &&
@@ -242,7 +242,7 @@ void do_cmd_wield(void)
242242 if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_RARM;
243243 }
244244
245- else if (!p_ptr->inventory_list[INVEN_RARM].k_idx && has_melee_weapon(INVEN_LARM))
245+ else if (!p_ptr->inventory_list[INVEN_RARM].k_idx && has_melee_weapon(p_ptr, INVEN_LARM))
246246 {
247247 if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_LARM;
248248 }
@@ -258,7 +258,7 @@ void do_cmd_wield(void)
258258 s = _("おっと。", "Oops.");
259259
260260 if (!choose_object(&slot, q, s, (USE_EQUIP), 0)) return;
261- if ((slot == INVEN_LARM) && !has_melee_weapon(INVEN_RARM))
261+ if ((slot == INVEN_LARM) && !has_melee_weapon(p_ptr, INVEN_RARM))
262262 need_switch_wielding = INVEN_RARM;
263263 }
264264 break;
@@ -471,7 +471,7 @@ void kamaenaoshi(INVENTORY_IDX item)
471471
472472 if (item == INVEN_RARM)
473473 {
474- if (has_melee_weapon(INVEN_LARM))
474+ if (has_melee_weapon(p_ptr, INVEN_LARM))
475475 {
476476 o_ptr = &p_ptr->inventory_list[INVEN_LARM];
477477 object_desc(o_name, o_ptr, 0);
@@ -501,7 +501,7 @@ void kamaenaoshi(INVENTORY_IDX item)
501501 o_ptr = &p_ptr->inventory_list[INVEN_RARM];
502502 if (o_ptr->k_idx) object_desc(o_name, o_ptr, 0);
503503
504- if (has_melee_weapon(INVEN_RARM))
504+ if (has_melee_weapon(p_ptr, INVEN_RARM))
505505 {
506506 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
507507 msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
--- a/src/cmd-pet.c
+++ b/src/cmd-pet.c
@@ -638,7 +638,7 @@ void do_cmd_pet(void)
638638
639639 powers[num++] = PET_RYOUTE;
640640 }
641- else if ((empty_hands(p_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
641+ else if ((empty_hands(p_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
642642 {
643643 if (p_ptr->pet_extra_flags & PF_RYOUTE)
644644 {
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -119,12 +119,12 @@ void exe_read(INVENTORY_IDX item, bool known)
119119 case SV_SCROLL_CURSE_WEAPON:
120120 {
121121 k = 0;
122- if (has_melee_weapon(INVEN_RARM))
122+ if (has_melee_weapon(p_ptr, INVEN_RARM))
123123 {
124124 k = INVEN_RARM;
125- if (has_melee_weapon(INVEN_LARM) && one_in_(2)) k = INVEN_LARM;
125+ if (has_melee_weapon(p_ptr, INVEN_LARM) && one_in_(2)) k = INVEN_LARM;
126126 }
127- else if (has_melee_weapon(INVEN_LARM)) k = INVEN_LARM;
127+ else if (has_melee_weapon(p_ptr, INVEN_LARM)) k = INVEN_LARM;
128128 if (k && curse_weapon(FALSE, k)) ident = TRUE;
129129 break;
130130 }
--- a/src/core.c
+++ b/src/core.c
@@ -2562,18 +2562,18 @@ static void process_world_aux_mutation(void)
25622562 take_hit(p_ptr, DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1);
25632563
25642564 msg_print(NULL);
2565- if (has_melee_weapon(INVEN_RARM))
2565+ if (has_melee_weapon(p_ptr, INVEN_RARM))
25662566 {
25672567 slot = INVEN_RARM;
25682568 o_ptr = &p_ptr->inventory_list[INVEN_RARM];
25692569
2570- if (has_melee_weapon(INVEN_LARM) && one_in_(2))
2570+ if (has_melee_weapon(p_ptr, INVEN_LARM) && one_in_(2))
25712571 {
25722572 o_ptr = &p_ptr->inventory_list[INVEN_LARM];
25732573 slot = INVEN_LARM;
25742574 }
25752575 }
2576- else if (has_melee_weapon(INVEN_LARM))
2576+ else if (has_melee_weapon(p_ptr, INVEN_LARM))
25772577 {
25782578 o_ptr = &p_ptr->inventory_list[INVEN_LARM];
25792579 slot = INVEN_LARM;
--- a/src/files.c
+++ b/src/files.c
@@ -1752,7 +1752,7 @@ static void display_player_melee_bonus(int hand, int hand_entry)
17521752 sprintf(buf, "(%+d,%+d)", (int)show_tohit, (int)show_todam);
17531753
17541754 /* Dump the bonuses to hit/dam */
1755- if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
1755+ if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
17561756 display_player_one_line(ENTRY_BARE_HAND, buf, TERM_L_BLUE);
17571757 else if (p_ptr->ryoute)
17581758 display_player_one_line(ENTRY_TWO_HANDS, buf, TERM_L_BLUE);
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -1317,7 +1317,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
13171317 {
13181318 case CLASS_ROGUE:
13191319 case CLASS_NINJA:
1320- if (has_melee_weapon(INVEN_RARM + hand) && !p_ptr->icky_wield[hand])
1320+ if (has_melee_weapon(p_ptr, INVEN_RARM + hand) && !p_ptr->icky_wield[hand])
13211321 {
13221322 int tmp = p_ptr->lev * 6 + (p_ptr->skill_stl + 10) * 4;
13231323 if (p_ptr->monlite && (mode != HISSATSU_NYUSIN)) tmp /= 3;
@@ -1787,7 +1787,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
17871787 }
17881788 else k = 1;
17891789 }
1790- else if ((p_ptr->pclass == CLASS_NINJA) && has_melee_weapon(INVEN_RARM + hand) && !p_ptr->icky_wield[hand] && ((p_ptr->cur_lite <= 0) || one_in_(7)))
1790+ else if ((p_ptr->pclass == CLASS_NINJA) && has_melee_weapon(p_ptr, INVEN_RARM + hand) && !p_ptr->icky_wield[hand] && ((p_ptr->cur_lite <= 0) || one_in_(7)))
17911791 {
17921792 int maxhp = maxroll(r_ptr->hdice, r_ptr->hside);
17931793 if (one_in_(backstab ? 13 : (stab_fleeing || fuiuchi) ? 15 : 27))
--- a/src/mind.c
+++ b/src/mind.c
@@ -864,8 +864,8 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
864864 put_str(format(_("Lv %s 失率 効果", "Lv %s Fail Info"),
865865 ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
866866
867- has_weapon[0] = has_melee_weapon(INVEN_RARM);
868- has_weapon[1] = has_melee_weapon(INVEN_LARM);
867+ has_weapon[0] = has_melee_weapon(p_ptr, INVEN_RARM);
868+ has_weapon[1] = has_melee_weapon(p_ptr, INVEN_LARM);
869869
870870 /* Dump the spells */
871871 for (i = 0; i < MAX_MIND_POWERS; i++)
@@ -1811,9 +1811,9 @@ void do_cmd_mind(void)
18111811 {
18121812 if (heavy_armor(p_ptr)) chance += 20;
18131813 if (p_ptr->icky_wield[0]) chance += 20;
1814- else if (has_melee_weapon(INVEN_RARM)) chance += 10;
1814+ else if (has_melee_weapon(p_ptr, INVEN_RARM)) chance += 10;
18151815 if (p_ptr->icky_wield[1]) chance += 20;
1816- else if (has_melee_weapon(INVEN_LARM)) chance += 10;
1816+ else if (has_melee_weapon(p_ptr, INVEN_LARM)) chance += 10;
18171817 if (n == 5)
18181818 {
18191819 int j;
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -4126,8 +4126,8 @@ HIT_POINT monspell_bluemage_damage(int SPELL_NUM, PLAYER_LEVEL plev, int TYPE)
41264126 int shoot_dd = 1, shoot_ds = 1, shoot_base = 0;
41274127 object_type *o_ptr = NULL;
41284128
4129- if (has_melee_weapon(INVEN_RARM)) o_ptr = &p_ptr->inventory_list[INVEN_RARM];
4130- else if (has_melee_weapon(INVEN_LARM)) o_ptr = &p_ptr->inventory_list[INVEN_LARM];
4129+ if (has_melee_weapon(p_ptr, INVEN_RARM)) o_ptr = &p_ptr->inventory_list[INVEN_RARM];
4130+ else if (has_melee_weapon(p_ptr, INVEN_LARM)) o_ptr = &p_ptr->inventory_list[INVEN_LARM];
41314131
41324132 if (o_ptr)
41334133 {
--- a/src/object2.c
+++ b/src/object2.c
@@ -4988,7 +4988,7 @@ void inven_item_increase(INVENTORY_IDX item, ITEM_NUMBER num)
49884988 {
49894989 if ((item == INVEN_RARM) || (item == INVEN_LARM))
49904990 {
4991- if (!has_melee_weapon(INVEN_RARM + INVEN_LARM - item))
4991+ if (!has_melee_weapon(p_ptr, INVEN_RARM + INVEN_LARM - item))
49924992 {
49934993 /* Clear all temporary elemental brands */
49944994 set_ele_attack(p_ptr, 0, 0);
--- a/src/patron.c
+++ b/src/patron.c
@@ -491,15 +491,15 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
491491
492492 case REW_CURSE_WP:
493493
494- if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM)) break;
494+ if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM)) break;
495495 msg_format(_("%sの声が響き渡った:", "The voice of %s booms out:"), chaos_patrons[creature_ptr->chaos_patron]);
496496 msg_print(_("「汝、武器に頼ることなかれ。」", "'Thou reliest too much on thy weapon.'"));
497497
498498 dummy = INVEN_RARM;
499- if (has_melee_weapon(INVEN_LARM))
499+ if (has_melee_weapon(p_ptr, INVEN_LARM))
500500 {
501501 dummy = INVEN_LARM;
502- if (has_melee_weapon(INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
502+ if (has_melee_weapon(p_ptr, INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
503503 }
504504 object_desc(o_name, &creature_ptr->inventory_list[dummy], OD_NAME_ONLY);
505505 (void)curse_weapon(FALSE, dummy);
@@ -535,12 +535,12 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
535535 case 3:
536536 if (one_in_(2))
537537 {
538- if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM)) break;
538+ if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM)) break;
539539 dummy = INVEN_RARM;
540- if (has_melee_weapon(INVEN_LARM))
540+ if (has_melee_weapon(p_ptr, INVEN_LARM))
541541 {
542542 dummy = INVEN_LARM;
543- if (has_melee_weapon(INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
543+ if (has_melee_weapon(p_ptr, INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
544544 }
545545 object_desc(o_name, &creature_ptr->inventory_list[dummy], OD_NAME_ONLY);
546546 (void)curse_weapon(FALSE, dummy);
@@ -580,12 +580,12 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
580580 {
581581 dummy = 0;
582582
583- if (has_melee_weapon(INVEN_RARM))
583+ if (has_melee_weapon(p_ptr, INVEN_RARM))
584584 {
585585 dummy = INVEN_RARM;
586- if (has_melee_weapon(INVEN_LARM) && one_in_(2)) dummy = INVEN_LARM;
586+ if (has_melee_weapon(p_ptr, INVEN_LARM) && one_in_(2)) dummy = INVEN_LARM;
587587 }
588- else if (has_melee_weapon(INVEN_LARM)) dummy = INVEN_LARM;
588+ else if (has_melee_weapon(p_ptr, INVEN_LARM)) dummy = INVEN_LARM;
589589
590590 if (dummy) (void)curse_weapon(FALSE, dummy);
591591 }
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -4019,7 +4019,7 @@ void calc_android_exp(player_type *creature_ptr)
40194019 if (value > 100000L)
40204020 exp += (value - 100000L) / 4 * level;
40214021 }
4022- if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
4022+ if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(p_ptr, i))) || (i == INVEN_BOW)) total_exp += exp / 48;
40234023 else total_exp += exp / 16;
40244024 if (i == INVEN_BODY) total_exp += exp / 32;
40254025 }
@@ -4216,7 +4216,7 @@ bool choose_ele_attack(player_type *creature_ptr)
42164216
42174217 char choice;
42184218
4219- if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
4219+ if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
42204220 {
42214221 msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
42224222 return FALSE;
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -1565,8 +1565,8 @@ void calc_bonuses(void)
15651565 /* Base skill -- digging */
15661566 p_ptr->skill_dig = 0;
15671567
1568- if (has_melee_weapon(INVEN_RARM)) p_ptr->migite = TRUE;
1569- if (has_melee_weapon(INVEN_LARM))
1568+ if (has_melee_weapon(p_ptr, INVEN_RARM)) p_ptr->migite = TRUE;
1569+ if (has_melee_weapon(p_ptr, INVEN_LARM))
15701570 {
15711571 p_ptr->hidarite = TRUE;
15721572 if (!p_ptr->migite) default_hand = 1;
@@ -2503,8 +2503,8 @@ void calc_bonuses(void)
25032503 }
25042504
25052505 /* Hack -- do not apply "weapon" bonuses */
2506- if (i == INVEN_RARM && has_melee_weapon(i)) continue;
2507- if (i == INVEN_LARM && has_melee_weapon(i)) continue;
2506+ if (i == INVEN_RARM && has_melee_weapon(p_ptr, i)) continue;
2507+ if (i == INVEN_LARM && has_melee_weapon(p_ptr, i)) continue;
25082508
25092509 /* Hack -- do not apply "bow" bonuses */
25102510 if (i == INVEN_BOW) continue;
@@ -3014,7 +3014,7 @@ void calc_bonuses(void)
30143014 p_ptr->dis_to_h[default_hand] += (p_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
30153015 }
30163016
3017- if (has_melee_weapon(INVEN_RARM) && has_melee_weapon(INVEN_LARM))
3017+ if (has_melee_weapon(p_ptr, INVEN_RARM) && has_melee_weapon(p_ptr, INVEN_LARM))
30183018 {
30193019 int penalty1, penalty2;
30203020 penalty1 = ((100 - p_ptr->skill_exp[GINOU_NITOURYU] / 160) - (130 - p_ptr->inventory_list[INVEN_RARM].weight) / 8);
@@ -3194,7 +3194,7 @@ void calc_bonuses(void)
31943194 p_ptr->icky_wield[i] = FALSE;
31953195 p_ptr->riding_wield[i] = FALSE;
31963196
3197- if (!has_melee_weapon(INVEN_RARM + i))
3197+ if (!has_melee_weapon(p_ptr, INVEN_RARM + i))
31983198 {
31993199 p_ptr->num_blow[i] = 1;
32003200 continue;
@@ -3465,7 +3465,7 @@ void calc_bonuses(void)
34653465 case CLASS_MONK:
34663466 case CLASS_FORCETRAINER:
34673467 case CLASS_BERSERKER:
3468- if ((empty_hands(p_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
3468+ if ((empty_hands(p_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
34693469 p_ptr->riding_ryoute = TRUE;
34703470 break;
34713471 }
@@ -3581,7 +3581,7 @@ void calc_bonuses(void)
35813581
35823582 for (i = 0; i < 2; i++)
35833583 {
3584- if (has_melee_weapon(INVEN_RARM + i))
3584+ if (has_melee_weapon(p_ptr, INVEN_RARM + i))
35853585 {
35863586 OBJECT_TYPE_VALUE tval = p_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN;
35873587 OBJECT_SUBTYPE_VALUE sval = p_ptr->inventory_list[INVEN_RARM + i].sval;
@@ -3763,7 +3763,7 @@ void calc_bonuses(void)
37633763 {
37643764 msg_print(_("こんな重い武器を装備しているのは大変だ。", "You have trouble wielding such a heavy weapon."));
37653765 }
3766- else if (has_melee_weapon(INVEN_RARM + i))
3766+ else if (has_melee_weapon(p_ptr, INVEN_RARM + i))
37673767 {
37683768 msg_print(_("これなら装備していても辛くない。", "You have no trouble wielding your weapon."));
37693769 }
@@ -3791,7 +3791,7 @@ void calc_bonuses(void)
37913791 {
37923792 msg_print(_("この武器は徒歩で使いやすい。", "This weapon was not suitable for use while riding."));
37933793 }
3794- else if (has_melee_weapon(INVEN_RARM + i))
3794+ else if (has_melee_weapon(p_ptr, INVEN_RARM + i))
37953795 {
37963796 msg_print(_("これなら乗馬中にぴったりだ。", "This weapon is suitable for use while riding."));
37973797 }
@@ -3810,7 +3810,7 @@ void calc_bonuses(void)
38103810 chg_virtue(p_ptr, V_FAITH, -1);
38113811 }
38123812 }
3813- else if (has_melee_weapon(INVEN_RARM + i))
3813+ else if (has_melee_weapon(p_ptr, INVEN_RARM + i))
38143814 {
38153815 msg_print(_("今の装備は自分にふさわしい気がする。", "You feel comfortable with your weapon."));
38163816 }
@@ -3963,7 +3963,7 @@ static void calc_alignment(void)
39633963
39643964 for (i = 0; i < 2; i++)
39653965 {
3966- if (has_melee_weapon(INVEN_RARM + i))
3966+ if (has_melee_weapon(p_ptr, INVEN_RARM + i))
39673967 {
39683968 if (p_ptr->inventory_list[INVEN_RARM + i].name1 == ART_IRON_BALL) p_ptr->align -= 1000;
39693969 }
@@ -4927,9 +4927,9 @@ WEIGHT weight_limit(void)
49274927 * @param i 判定する手のID(右手:0 左手:1)
49284928 * @return 持っているならばTRUE
49294929 */
4930-bool has_melee_weapon(int i)
4930+bool has_melee_weapon(player_type *creature_ptr, int i)
49314931 {
4932- return ((p_ptr->inventory_list[i].k_idx && object_is_melee_weapon(&p_ptr->inventory_list[i])) ? TRUE : FALSE);
4932+ return ((creature_ptr->inventory_list[i].k_idx && object_is_melee_weapon(&creature_ptr->inventory_list[i])) ? TRUE : FALSE);
49334933 }
49344934
49354935 /*!
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -733,7 +733,7 @@ extern int spell_exp_level(int spell_exp);
733733 extern s16b calc_num_fire(object_type *o_ptr);
734734 extern void calc_bonuses(void);
735735 extern WEIGHT weight_limit(void);
736-extern bool has_melee_weapon(int i);
736+extern bool has_melee_weapon(player_type *creature_ptr, int i);
737737 extern bool is_heavy_shoot(object_type *o_ptr);
738738
739739 extern bool heavy_armor(player_type *creature_ptr);
--- a/src/racial.c
+++ b/src/racial.c
@@ -565,7 +565,7 @@ static bool cmd_racial_power_aux(s32b command)
565565 }
566566 else if (command == -4)
567567 {
568- if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
568+ if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
569569 {
570570 msg_print(_("武器を持たないといけません。", "You need to wield a weapon."));
571571 return FALSE;
--- a/src/realm-hissatsu.c
+++ b/src/realm-hissatsu.c
@@ -592,7 +592,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
592592 {
593593 int damage;
594594
595- if (!has_melee_weapon(INVEN_RARM + i)) break;
595+ if (!has_melee_weapon(p_ptr, INVEN_RARM + i)) break;
596596 o_ptr = &p_ptr->inventory_list[INVEN_RARM + i];
597597 basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
598598 damage = o_ptr->to_d * 100;
@@ -871,7 +871,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
871871 for (i = 0; i < 2; i++)
872872 {
873873 int damage;
874- if (!has_melee_weapon(INVEN_RARM + i)) break;
874+ if (!has_melee_weapon(p_ptr, INVEN_RARM + i)) break;
875875 o_ptr = &p_ptr->inventory_list[INVEN_RARM + i];
876876 basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
877877 damage = o_ptr->to_d * 100;
Show on old repository browser