OSDN Git Service

[Refactor] #1473 Replaced the getting part of casting_hex_flags() from macro function...
authorHourier <grapefox.whitelucifer.0408@gmail.com>
Sat, 11 Sep 2021 11:40:52 +0000 (20:40 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Tue, 14 Sep 2021 14:07:49 +0000 (23:07 +0900)
src/spell-realm/spells-hex.cpp

index ec53c40..8e99023 100644 (file)
@@ -82,7 +82,7 @@ bool RealmHex::stop_all_spells()
  */
 bool RealmHex::stop_one_spell()
 {
-    if (!RealmHex(this->player_ptr).is_spelling_any()) {
+    if (!this->is_spelling_any()) {
         msg_print(_("呪文を詠唱していません。", "You are not casting a spell."));
         return false;
     }
@@ -163,12 +163,11 @@ void RealmHex::display_casting_spells_list()
  */
 void RealmHex::decrease_mana()
 {
-    /* Spells spelled by player */
     if (this->player_ptr->realm1 != REALM_HEX) {
         return;
     }
 
-    if (!casting_hex_flags(this->player_ptr) && !this->player_ptr->magic_num1[1]) {
+    if (!this->is_spelling_any() && !this->player_ptr->magic_num1[1]) {
         return;
     }
 
@@ -192,6 +191,7 @@ void RealmHex::decrease_mana()
  * @brief 継続的な呪文の詠唱が可能な程度にMPが残っているか確認し、残量に応じて継続・中断を行う
  * @param need_restart 詠唱を再開するか否か
  * @return MPが足りているか否か
+ * @todo 64ビットの割り算をしなければいけない箇所には見えない. 調査の後不要ならば消すこと.
  */
 bool RealmHex::process_mana_cost(const bool need_restart)
 {
@@ -384,7 +384,7 @@ bool RealmHex::is_spelling_specific(int hex) const
 
 bool RealmHex::is_spelling_any() const
 {
-    return (player_ptr->realm1 == REALM_HEX) && (player_ptr->magic_num1[0] != 0);
+    return (this->player_ptr->realm1 == REALM_HEX) && (this->player_ptr->magic_num1[0] != 0);
 }
 
 /*!