OSDN Git Service

Merge branch 'develop' into macos-develop
[hengbandforosx/hengbandosx.git] / src / player-status / player-stealth.cpp
index e9a1308..89dd9f3 100644 (file)
@@ -1,4 +1,4 @@
-#include "player-status/player-stealth.h"
+#include "player-status/player-stealth.h"
 #include "mind/mind-ninja.h"
 #include "mutation/mutation-flag-types.h"
 #include "player-base/player-class.h"
@@ -67,14 +67,15 @@ int16_t PlayerStealth::class_base_bonus()
  */
 int16_t PlayerStealth::class_bonus()
 {
-    if (!PlayerClass(this->player_ptr).equals(PlayerClassType::NINJA)) {
+    PlayerClass pc(this->player_ptr);
+    if (!pc.equals(PlayerClassType::NINJA)) {
         return 0;
     }
 
     int16_t bonus = 0;
     if (heavy_armor(this->player_ptr)) {
         bonus -= (this->player_ptr->lev) / 10;
-    } else if ((!this->player_ptr->inventory_list[INVEN_MAIN_HAND].bi_id || can_attack_with_main_hand(this->player_ptr)) && (!this->player_ptr->inventory_list[INVEN_SUB_HAND].bi_id || can_attack_with_sub_hand(this->player_ptr))) {
+    } else if (pc.has_ninja_speed()) {
         bonus += (this->player_ptr->lev) / 10;
     }