OSDN Git Service

[Refactor] #38997 has_melee_weapon() に player_type * 引数を追加.
authordeskull <deskull@users.sourceforge.jp>
Wed, 10 Jul 2019 03:30:33 +0000 (12:30 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 10 Jul 2019 03:30:33 +0000 (12:30 +0900)
17 files changed:
src/cmd-basic.c
src/cmd-hissatsu.c
src/cmd-item.c
src/cmd-pet.c
src/cmd-read.c
src/core.c
src/files.c
src/melee1.c
src/mind.c
src/mspells4.c
src/object2.c
src/patron.c
src/player-effects.c
src/player-status.c
src/player-status.h
src/racial.c
src/realm-hissatsu.c

index c155941..c0247ca 100644 (file)
@@ -2374,7 +2374,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
        }
        else if (boomerang)
        {
-               if (has_melee_weapon(INVEN_RARM) && has_melee_weapon(INVEN_LARM))
+               if (has_melee_weapon(p_ptr, INVEN_RARM) && has_melee_weapon(p_ptr, INVEN_LARM))
                {
                        item_tester_hook = item_tester_hook_boomerang;
                        q = _("どの武器を投げますか? ", "Throw which item? ");
@@ -2386,7 +2386,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
                                return FALSE;
                        }
                }
-               else if (has_melee_weapon(INVEN_LARM))
+               else if (has_melee_weapon(p_ptr, INVEN_LARM))
                {
                        item = INVEN_LARM;
                        o_ptr = &p_ptr->inventory_list[item];
index cc51db0..842a6a7 100644 (file)
@@ -319,7 +319,7 @@ void do_cmd_hissatsu(void)
        magic_type      spell;
 
        if (cmd_limit_confused(p_ptr)) return;
-       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
+       if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
        {
                if (flush_failure) flush();
                msg_print(_("武器を持たないと必殺技は使えない!", "You need to wield a weapon!"));
index c21e908..3907c97 100644 (file)
@@ -203,7 +203,7 @@ void do_cmd_wield(void)
        case TV_SHIELD:
        case TV_CARD:
                /* Dual wielding */
-               if (has_melee_weapon(INVEN_RARM) && has_melee_weapon(INVEN_LARM))
+               if (has_melee_weapon(p_ptr, INVEN_RARM) && has_melee_weapon(p_ptr, INVEN_LARM))
                {
                        /* Restrict the choices */
                        item_tester_hook = item_tester_hook_melee_weapon;
@@ -215,7 +215,7 @@ void do_cmd_wield(void)
                        if (slot == INVEN_RARM) need_switch_wielding = INVEN_LARM;
                }
 
-               else if (has_melee_weapon(INVEN_LARM)) slot = INVEN_RARM;
+               else if (has_melee_weapon(p_ptr, INVEN_LARM)) slot = INVEN_RARM;
 
                /* Both arms are already used by non-weapon */
                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)
                        if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_RARM;
                }
 
-               else if (!p_ptr->inventory_list[INVEN_RARM].k_idx && has_melee_weapon(INVEN_LARM))
+               else if (!p_ptr->inventory_list[INVEN_RARM].k_idx && has_melee_weapon(p_ptr, INVEN_LARM))
                {
                        if (!get_check(_("二刀流で戦いますか?", "Dual wielding? "))) slot = INVEN_LARM;
                }
@@ -258,7 +258,7 @@ void do_cmd_wield(void)
                        s = _("おっと。", "Oops.");
                        
                        if (!choose_object(&slot, q, s, (USE_EQUIP), 0)) return;
-                       if ((slot == INVEN_LARM) && !has_melee_weapon(INVEN_RARM))
+                       if ((slot == INVEN_LARM) && !has_melee_weapon(p_ptr, INVEN_RARM))
                                need_switch_wielding = INVEN_RARM;
                }
                break;
@@ -471,7 +471,7 @@ void kamaenaoshi(INVENTORY_IDX item)
 
        if (item == INVEN_RARM)
        {
-               if (has_melee_weapon(INVEN_LARM))
+               if (has_melee_weapon(p_ptr, INVEN_LARM))
                {
                        o_ptr = &p_ptr->inventory_list[INVEN_LARM];
                        object_desc(o_name, o_ptr, 0);
@@ -501,7 +501,7 @@ void kamaenaoshi(INVENTORY_IDX item)
                o_ptr = &p_ptr->inventory_list[INVEN_RARM];
                if (o_ptr->k_idx) object_desc(o_name, o_ptr, 0);
 
-               if (has_melee_weapon(INVEN_RARM))
+               if (has_melee_weapon(p_ptr, INVEN_RARM))
                {
                        if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
                                msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
index 5616d7f..918efb9 100644 (file)
@@ -638,7 +638,7 @@ void do_cmd_pet(void)
 
                                        powers[num++] = PET_RYOUTE;
                                }
-                               else if ((empty_hands(p_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
+                               else if ((empty_hands(p_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
                                {
                                        if (p_ptr->pet_extra_flags & PF_RYOUTE)
                                        {
index 611ee21..74715db 100644 (file)
@@ -119,12 +119,12 @@ void exe_read(INVENTORY_IDX item, bool known)
                case SV_SCROLL_CURSE_WEAPON:
                {
                        k = 0;
-                       if (has_melee_weapon(INVEN_RARM))
+                       if (has_melee_weapon(p_ptr, INVEN_RARM))
                        {
                                k = INVEN_RARM;
-                               if (has_melee_weapon(INVEN_LARM) && one_in_(2)) k = INVEN_LARM;
+                               if (has_melee_weapon(p_ptr, INVEN_LARM) && one_in_(2)) k = INVEN_LARM;
                        }
-                       else if (has_melee_weapon(INVEN_LARM)) k = INVEN_LARM;
+                       else if (has_melee_weapon(p_ptr, INVEN_LARM)) k = INVEN_LARM;
                        if (k && curse_weapon(FALSE, k)) ident = TRUE;
                        break;
                }
index 1d464e6..f54f738 100644 (file)
@@ -2562,18 +2562,18 @@ static void process_world_aux_mutation(void)
                take_hit(p_ptr, DAMAGE_NOESCAPE, randint1(p_ptr->wt / 6), _("転倒", "tripping"), -1);
 
                msg_print(NULL);
-               if (has_melee_weapon(INVEN_RARM))
+               if (has_melee_weapon(p_ptr, INVEN_RARM))
                {
                        slot = INVEN_RARM;
                        o_ptr = &p_ptr->inventory_list[INVEN_RARM];
 
-                       if (has_melee_weapon(INVEN_LARM) && one_in_(2))
+                       if (has_melee_weapon(p_ptr, INVEN_LARM) && one_in_(2))
                        {
                                o_ptr = &p_ptr->inventory_list[INVEN_LARM];
                                slot = INVEN_LARM;
                        }
                }
-               else if (has_melee_weapon(INVEN_LARM))
+               else if (has_melee_weapon(p_ptr, INVEN_LARM))
                {
                        o_ptr = &p_ptr->inventory_list[INVEN_LARM];
                        slot = INVEN_LARM;
index b0f0413..8491637 100644 (file)
@@ -1752,7 +1752,7 @@ static void display_player_melee_bonus(int hand, int hand_entry)
        sprintf(buf, "(%+d,%+d)", (int)show_tohit, (int)show_todam);
 
        /* Dump the bonuses to hit/dam */
-       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
+       if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
                display_player_one_line(ENTRY_BARE_HAND, buf, TERM_L_BLUE);
        else if (p_ptr->ryoute)
                display_player_one_line(ENTRY_TWO_HANDS, buf, TERM_L_BLUE);
index 62a8696..ad95987 100644 (file)
@@ -1317,7 +1317,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
        {
        case CLASS_ROGUE:
        case CLASS_NINJA:
-               if (has_melee_weapon(INVEN_RARM + hand) && !p_ptr->icky_wield[hand])
+               if (has_melee_weapon(p_ptr, INVEN_RARM + hand) && !p_ptr->icky_wield[hand])
                {
                        int tmp = p_ptr->lev * 6 + (p_ptr->skill_stl + 10) * 4;
                        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
                                }
                                else k = 1;
                        }
-                       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)))
+                       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)))
                        {
                                int maxhp = maxroll(r_ptr->hdice, r_ptr->hside);
                                if (one_in_(backstab ? 13 : (stab_fleeing || fuiuchi) ? 15 : 27))
index 60c2f33..fb64dba 100644 (file)
@@ -864,8 +864,8 @@ static bool_hack get_mind_power(SPELL_IDX *sn, bool only_browse)
                                put_str(format(_("Lv   %s   失率 効果", "Lv   %s   Fail Info"),
                                        ((use_mind == MIND_BERSERKER) || (use_mind == MIND_NINJUTSU)) ? "HP" : "MP"), y, x + 35);
 
-                               has_weapon[0] = has_melee_weapon(INVEN_RARM);
-                               has_weapon[1] = has_melee_weapon(INVEN_LARM);
+                               has_weapon[0] = has_melee_weapon(p_ptr, INVEN_RARM);
+                               has_weapon[1] = has_melee_weapon(p_ptr, INVEN_LARM);
 
                                /* Dump the spells */
                                for (i = 0; i < MAX_MIND_POWERS; i++)
@@ -1811,9 +1811,9 @@ void do_cmd_mind(void)
        {
                if (heavy_armor(p_ptr)) chance += 20;
                if (p_ptr->icky_wield[0]) chance += 20;
-               else if (has_melee_weapon(INVEN_RARM)) chance += 10;
+               else if (has_melee_weapon(p_ptr, INVEN_RARM)) chance += 10;
                if (p_ptr->icky_wield[1]) chance += 20;
-               else if (has_melee_weapon(INVEN_LARM)) chance += 10;
+               else if (has_melee_weapon(p_ptr, INVEN_LARM)) chance += 10;
                if (n == 5)
                {
                        int j;
index e6c4eef..c40192a 100644 (file)
@@ -4126,8 +4126,8 @@ HIT_POINT monspell_bluemage_damage(int SPELL_NUM, PLAYER_LEVEL plev, int TYPE)
        int shoot_dd = 1, shoot_ds = 1, shoot_base = 0;
        object_type *o_ptr = NULL;
 
-       if (has_melee_weapon(INVEN_RARM)) o_ptr = &p_ptr->inventory_list[INVEN_RARM];
-       else if (has_melee_weapon(INVEN_LARM)) o_ptr = &p_ptr->inventory_list[INVEN_LARM];
+       if (has_melee_weapon(p_ptr, INVEN_RARM)) o_ptr = &p_ptr->inventory_list[INVEN_RARM];
+       else if (has_melee_weapon(p_ptr, INVEN_LARM)) o_ptr = &p_ptr->inventory_list[INVEN_LARM];
 
        if (o_ptr)
        {
index c34786d..cdef806 100644 (file)
@@ -4988,7 +4988,7 @@ void inven_item_increase(INVENTORY_IDX item, ITEM_NUMBER num)
                {
                        if ((item == INVEN_RARM) || (item == INVEN_LARM))
                        {
-                               if (!has_melee_weapon(INVEN_RARM + INVEN_LARM - item))
+                               if (!has_melee_weapon(p_ptr, INVEN_RARM + INVEN_LARM - item))
                                {
                                        /* Clear all temporary elemental brands */
                                        set_ele_attack(p_ptr, 0, 0);
index aacecaa..071e5de 100644 (file)
@@ -491,15 +491,15 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
 
                case REW_CURSE_WP:
 
-                       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM)) break;
+                       if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM)) break;
                        msg_format(_("%sの声が響き渡った:", "The voice of %s booms out:"), chaos_patrons[creature_ptr->chaos_patron]);
                        msg_print(_("「汝、武器に頼ることなかれ。」", "'Thou reliest too much on thy weapon.'"));
 
                        dummy = INVEN_RARM;
-                       if (has_melee_weapon(INVEN_LARM))
+                       if (has_melee_weapon(p_ptr, INVEN_LARM))
                        {
                                dummy = INVEN_LARM;
-                               if (has_melee_weapon(INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
+                               if (has_melee_weapon(p_ptr, INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
                        }
                        object_desc(o_name, &creature_ptr->inventory_list[dummy], OD_NAME_ONLY);
                        (void)curse_weapon(FALSE, dummy);
@@ -535,12 +535,12 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
                        case 3:
                                if (one_in_(2))
                                {
-                                       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM)) break;
+                                       if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM)) break;
                                        dummy = INVEN_RARM;
-                                       if (has_melee_weapon(INVEN_LARM))
+                                       if (has_melee_weapon(p_ptr, INVEN_LARM))
                                        {
                                                dummy = INVEN_LARM;
-                                               if (has_melee_weapon(INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
+                                               if (has_melee_weapon(p_ptr, INVEN_RARM) && one_in_(2)) dummy = INVEN_RARM;
                                        }
                                        object_desc(o_name, &creature_ptr->inventory_list[dummy], OD_NAME_ONLY);
                                        (void)curse_weapon(FALSE, dummy);
@@ -580,12 +580,12 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
                        {
                                dummy = 0;
 
-                               if (has_melee_weapon(INVEN_RARM))
+                               if (has_melee_weapon(p_ptr, INVEN_RARM))
                                {
                                        dummy = INVEN_RARM;
-                                       if (has_melee_weapon(INVEN_LARM) && one_in_(2)) dummy = INVEN_LARM;
+                                       if (has_melee_weapon(p_ptr, INVEN_LARM) && one_in_(2)) dummy = INVEN_LARM;
                                }
-                               else if (has_melee_weapon(INVEN_LARM)) dummy = INVEN_LARM;
+                               else if (has_melee_weapon(p_ptr, INVEN_LARM)) dummy = INVEN_LARM;
 
                                if (dummy) (void)curse_weapon(FALSE, dummy);
                        }
index bb972bf..eaecde1 100644 (file)
@@ -4019,7 +4019,7 @@ void calc_android_exp(player_type *creature_ptr)
                        if (value > 100000L)
                                exp += (value - 100000L) / 4  * level;
                }
-               if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(i))) || (i == INVEN_BOW)) total_exp += exp / 48;
+               if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(p_ptr, i))) || (i == INVEN_BOW)) total_exp += exp / 48;
                else total_exp += exp / 16;
                if (i == INVEN_BODY) total_exp += exp / 32;
        }
@@ -4216,7 +4216,7 @@ bool choose_ele_attack(player_type *creature_ptr)
 
        char choice;
 
-       if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
+       if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
        {
                msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
                return FALSE;
index ca5a7a5..2966f25 100644 (file)
@@ -1565,8 +1565,8 @@ void calc_bonuses(void)
        /* Base skill -- digging */
        p_ptr->skill_dig = 0;
 
-       if (has_melee_weapon(INVEN_RARM)) p_ptr->migite = TRUE;
-       if (has_melee_weapon(INVEN_LARM))
+       if (has_melee_weapon(p_ptr, INVEN_RARM)) p_ptr->migite = TRUE;
+       if (has_melee_weapon(p_ptr, INVEN_LARM))
        {
                p_ptr->hidarite = TRUE;
                if (!p_ptr->migite) default_hand = 1;
@@ -2503,8 +2503,8 @@ void calc_bonuses(void)
                }
 
                /* Hack -- do not apply "weapon" bonuses */
-               if (i == INVEN_RARM && has_melee_weapon(i)) continue;
-               if (i == INVEN_LARM && has_melee_weapon(i)) continue;
+               if (i == INVEN_RARM && has_melee_weapon(p_ptr, i)) continue;
+               if (i == INVEN_LARM && has_melee_weapon(p_ptr, i)) continue;
 
                /* Hack -- do not apply "bow" bonuses */
                if (i == INVEN_BOW) continue;
@@ -3014,7 +3014,7 @@ void calc_bonuses(void)
                p_ptr->dis_to_h[default_hand] += (p_ptr->skill_exp[GINOU_SUDE] - WEAPON_EXP_BEGINNER) / 200;
        }
 
-       if (has_melee_weapon(INVEN_RARM) && has_melee_weapon(INVEN_LARM))
+       if (has_melee_weapon(p_ptr, INVEN_RARM) && has_melee_weapon(p_ptr, INVEN_LARM))
        {
                int penalty1, penalty2;
                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)
                p_ptr->icky_wield[i] = FALSE;
                p_ptr->riding_wield[i] = FALSE;
 
-               if (!has_melee_weapon(INVEN_RARM + i))
+               if (!has_melee_weapon(p_ptr, INVEN_RARM + i))
                {
                        p_ptr->num_blow[i] = 1;
                        continue;
@@ -3465,7 +3465,7 @@ void calc_bonuses(void)
                        case CLASS_MONK:
                        case CLASS_FORCETRAINER:
                        case CLASS_BERSERKER:
-                               if ((empty_hands(p_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
+                               if ((empty_hands(p_ptr, FALSE) != EMPTY_HAND_NONE) && !has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
                                        p_ptr->riding_ryoute = TRUE;
                                break;
                        }
@@ -3581,7 +3581,7 @@ void calc_bonuses(void)
 
        for (i = 0; i < 2; i++)
        {
-               if (has_melee_weapon(INVEN_RARM + i))
+               if (has_melee_weapon(p_ptr, INVEN_RARM + i))
                {
                        OBJECT_TYPE_VALUE tval = p_ptr->inventory_list[INVEN_RARM + i].tval - TV_WEAPON_BEGIN;
                        OBJECT_SUBTYPE_VALUE sval = p_ptr->inventory_list[INVEN_RARM + i].sval;
@@ -3763,7 +3763,7 @@ void calc_bonuses(void)
                        {
                                msg_print(_("こんな重い武器を装備しているのは大変だ。", "You have trouble wielding such a heavy weapon."));
                        }
-                       else if (has_melee_weapon(INVEN_RARM + i))
+                       else if (has_melee_weapon(p_ptr, INVEN_RARM + i))
                        {
                                msg_print(_("これなら装備していても辛くない。", "You have no trouble wielding your weapon."));
                        }
@@ -3791,7 +3791,7 @@ void calc_bonuses(void)
                        {
                                msg_print(_("この武器は徒歩で使いやすい。", "This weapon was not suitable for use while riding."));
                        }
-                       else if (has_melee_weapon(INVEN_RARM + i))
+                       else if (has_melee_weapon(p_ptr, INVEN_RARM + i))
                        {
                                msg_print(_("これなら乗馬中にぴったりだ。", "This weapon is suitable for use while riding."));
                        }
@@ -3810,7 +3810,7 @@ void calc_bonuses(void)
                                        chg_virtue(p_ptr, V_FAITH, -1);
                                }
                        }
-                       else if (has_melee_weapon(INVEN_RARM + i))
+                       else if (has_melee_weapon(p_ptr, INVEN_RARM + i))
                        {
                                msg_print(_("今の装備は自分にふさわしい気がする。", "You feel comfortable with your weapon."));
                        }
@@ -3963,7 +3963,7 @@ static void calc_alignment(void)
 
        for (i = 0; i < 2; i++)
        {
-               if (has_melee_weapon(INVEN_RARM + i))
+               if (has_melee_weapon(p_ptr, INVEN_RARM + i))
                {
                        if (p_ptr->inventory_list[INVEN_RARM + i].name1 == ART_IRON_BALL) p_ptr->align -= 1000;
                }
@@ -4927,9 +4927,9 @@ WEIGHT weight_limit(void)
  * @param i 判定する手のID(右手:0 左手:1)
  * @return 持っているならばTRUE
  */
-bool has_melee_weapon(int i)
+bool has_melee_weapon(player_type *creature_ptr, int i)
 {
-       return ((p_ptr->inventory_list[i].k_idx && object_is_melee_weapon(&p_ptr->inventory_list[i])) ? TRUE : FALSE);
+       return ((creature_ptr->inventory_list[i].k_idx && object_is_melee_weapon(&creature_ptr->inventory_list[i])) ? TRUE : FALSE);
 }
 
 /*!
index a8d7cf6..e8e8fd6 100644 (file)
@@ -733,7 +733,7 @@ extern int spell_exp_level(int spell_exp);
 extern s16b calc_num_fire(object_type *o_ptr);
 extern void calc_bonuses(void);
 extern WEIGHT weight_limit(void);
-extern bool has_melee_weapon(int i);
+extern bool has_melee_weapon(player_type *creature_ptr, int i);
 extern bool is_heavy_shoot(object_type *o_ptr);
 
 extern bool heavy_armor(player_type *creature_ptr);
index 21e7585..0f4fbaa 100644 (file)
@@ -565,7 +565,7 @@ static bool cmd_racial_power_aux(s32b command)
                        }
                        else if (command == -4)
                        {
-                               if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
+                               if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
                                {
                                        msg_print(_("武器を持たないといけません。", "You need to wield a weapon."));
                                        return FALSE;
index c7b8b61..b706fdf 100644 (file)
@@ -592,7 +592,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                int damage;
 
-                               if (!has_melee_weapon(INVEN_RARM + i)) break;
+                               if (!has_melee_weapon(p_ptr, INVEN_RARM + i)) break;
                                o_ptr = &p_ptr->inventory_list[INVEN_RARM + i];
                                basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
                                damage = o_ptr->to_d * 100;
@@ -871,7 +871,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode)
                        for (i = 0; i < 2; i++)
                        {
                                int damage;
-                               if (!has_melee_weapon(INVEN_RARM + i)) break;
+                               if (!has_melee_weapon(p_ptr, INVEN_RARM + i)) break;
                                o_ptr = &p_ptr->inventory_list[INVEN_RARM + i];
                                basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
                                damage = o_ptr->to_d * 100;