OSDN Git Service

[Fix] #40955 攻撃可能判定の条件によって、普通の職業で素手のときに攻撃回数が0になってしまい、かつ、実際に打撃攻撃ができなくなってたので修正。 / Norma...
authoriks <iks@users.sorceforge.jp>
Sun, 15 Nov 2020 15:35:08 +0000 (00:35 +0900)
committeriks <iks@users.sorceforge.jp>
Sun, 15 Nov 2020 15:35:08 +0000 (00:35 +0900)
src/player/player-status-flags.c

index 00e9bb9..bb437ec 100644 (file)
@@ -1528,26 +1528,25 @@ BIT_FLAGS has_immune_dark(player_type *creature_ptr)
     return result;
 }
 
+/*
+ * @brief 右手(利き手)が武器を持っているかどうかを判定する
+ * @detail Includes martial arts and hand combats as weapons.
+ */
 bool has_right_hand_weapon(player_type *creature_ptr)
 {
     if (has_melee_weapon(creature_ptr, INVEN_RARM))
         return TRUE;
 
-    if (can_two_hands_wielding(creature_ptr)) {
-        switch (creature_ptr->pclass) {
-        case CLASS_MONK:
-        case CLASS_FORCETRAINER:
-        case CLASS_BERSERKER:
-            if (empty_hands(creature_ptr, FALSE) == (EMPTY_HAND_RARM | EMPTY_HAND_LARM)) {
-                return TRUE;
-            }
-            break;
-        }
-    }
+    if ((empty_hands(creature_ptr, TRUE) & EMPTY_HAND_RARM) && !has_left_hand_weapon(creature_ptr))
+        return TRUE;
 
     return FALSE;
 }
 
+/*
+ * @brief 左手(非利き手)が武器を持っているかどうかを判定する
+ * @detail Exclude martial arts and hand combats from weapons.
+ */
 bool has_left_hand_weapon(player_type *creature_ptr) { return has_melee_weapon(creature_ptr, INVEN_LARM); }
 
 bool has_two_handed_weapons(player_type *creature_ptr)