From: Habu Date: Sun, 7 Feb 2021 08:22:21 +0000 (+0900) Subject: [fix] MPの無い職業に設定される定数を定義 X-Git-Url: http://git.osdn.net/view?p=hengband%2Fhengband.git;a=commitdiff_plain;h=c89e3672f7e7fa0c301b5a4327d11c32b4bba441 [fix] MPの無い職業に設定される定数を定義 m_info.txtにおいて、MPの無い職業のspell_firstに99を設定するが、 ソースコード上ではマジックナンバーとならないように SPELL_FIRST_NO_SPELL を定義して使用する。 --- diff --git a/src/player/player-class.h b/src/player/player-class.h index 661c44449..f2900dfc7 100644 --- a/src/player/player-class.h +++ b/src/player/player-class.h @@ -7,6 +7,9 @@ #include "system/angband.h" #include "spell/technic-info-table.h" +/** m_info.txtでMPの無い職業に設定される */ +#define SPELL_FIRST_NO_SPELL 99 + /* * Information about the player's "magic" * diff --git a/src/player/player-status.c b/src/player/player-status.c index c3ca9686b..92d47ab16 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -893,7 +893,7 @@ static void calc_spells(player_type *creature_ptr) */ static void calc_mana(player_type *creature_ptr) { - if (!mp_ptr->spell_book && mp_ptr->spell_first == 99) + if (!mp_ptr->spell_book && mp_ptr->spell_first == SPELL_FIRST_NO_SPELL) return; int levels; diff --git a/src/window/main-window-left-frame.c b/src/window/main-window-left-frame.c index 5ada11afe..f74f65836 100644 --- a/src/window/main-window-left-frame.c +++ b/src/window/main-window-left-frame.c @@ -140,7 +140,7 @@ void print_sp(player_type *creature_ptr) { char tmp[32]; byte color; - if (!mp_ptr->spell_book && mp_ptr->spell_first == 99) + if (!mp_ptr->spell_book && mp_ptr->spell_first == SPELL_FIRST_NO_SPELL) return; put_str(_("MP", "SP"), ROW_CURSP, COL_CURSP);