m_info.txtにおいて、MPの無い職業のspell_firstに99を設定するが、
ソースコード上ではマジックナンバーとならないように
SPELL_FIRST_NO_SPELL を定義して使用する。
#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"
*
*/
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;
{
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);