修訂 | c89e3672f7e7fa0c301b5a4327d11c32b4bba441 (tree) |
---|---|
時間 | 2021-02-07 17:22:21 |
作者 | Habu <habu@user...> |
Commiter | Habu |
[fix] MPの無い職業に設定される定数を定義
m_info.txtにおいて、MPの無い職業のspell_firstに99を設定するが、
ソースコード上ではマジックナンバーとならないように
SPELL_FIRST_NO_SPELL を定義して使用する。
@@ -7,6 +7,9 @@ | ||
7 | 7 | #include "system/angband.h" |
8 | 8 | #include "spell/technic-info-table.h" |
9 | 9 | |
10 | +/** m_info.txtでMPの無い職業に設定される */ | |
11 | +#define SPELL_FIRST_NO_SPELL 99 | |
12 | + | |
10 | 13 | /* |
11 | 14 | * Information about the player's "magic" |
12 | 15 | * |
@@ -893,7 +893,7 @@ static void calc_spells(player_type *creature_ptr) | ||
893 | 893 | */ |
894 | 894 | static void calc_mana(player_type *creature_ptr) |
895 | 895 | { |
896 | - if (!mp_ptr->spell_book && mp_ptr->spell_first == 99) | |
896 | + if (!mp_ptr->spell_book && mp_ptr->spell_first == SPELL_FIRST_NO_SPELL) | |
897 | 897 | return; |
898 | 898 | |
899 | 899 | int levels; |
@@ -140,7 +140,7 @@ void print_sp(player_type *creature_ptr) | ||
140 | 140 | { |
141 | 141 | char tmp[32]; |
142 | 142 | byte color; |
143 | - if (!mp_ptr->spell_book && mp_ptr->spell_first == 99) | |
143 | + if (!mp_ptr->spell_book && mp_ptr->spell_first == SPELL_FIRST_NO_SPELL) | |
144 | 144 | return; |
145 | 145 | |
146 | 146 | put_str(_("MP", "SP"), ROW_CURSP, COL_CURSP); |