OSDN Git Service

[Refactor] #1469 Reshaped hex_spell_fully()
authorHourier <grapefox.whitelucifer.0408@gmail.com>
Mon, 6 Sep 2021 09:18:05 +0000 (18:18 +0900)
committerHourier <grapefox.whitelucifer.0408@gmail.com>
Tue, 7 Sep 2021 09:08:33 +0000 (18:08 +0900)
src/spell-realm/spells-hex.cpp
src/spell-realm/spells-hex.h

index 292a7e4..8db50ed 100644 (file)
@@ -293,14 +293,11 @@ void RealmHex::gain_exp_master(const int spell)
  * @brief プレイヤーの呪術詠唱枠がすでに最大かどうかを返す
  * @return すでに全枠を利用しているならTRUEを返す
  */
-bool RealmHex::hex_spell_fully()
+bool RealmHex::hex_spell_fully() const
 {
-    int k_max = 0;
-    k_max = (caster_ptr->lev / 15) + 1;
+    auto k_max = (this->caster_ptr->lev / 15) + 1;
     k_max = MIN(k_max, MAX_KEEP);
-    if (casting_hex_num(caster_ptr) < k_max)
-        return false;
-    return true;
+    return casting_hex_num(this->caster_ptr) >= k_max;
 }
 
 /*!
index 03f1897..7ce6fe4 100644 (file)
@@ -12,7 +12,7 @@ public:
     bool stop_hex_spell();
     void check_hex();
     bool stop_hex_spell_all();
-    bool hex_spell_fully();
+    bool hex_spell_fully() const;
 
 private:
     player_type *caster_ptr;