• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: 提交

変愚蛮怒のメインリポジトリです


Commit MetaInfo

修訂c89e3672f7e7fa0c301b5a4327d11c32b4bba441 (tree)
時間2021-02-07 17:22:21
作者Habu <habu@user...>
CommiterHabu

Log Message

[fix] MPの無い職業に設定される定数を定義

m_info.txtにおいて、MPの無い職業のspell_firstに99を設定するが、
ソースコード上ではマジックナンバーとならないように
SPELL_FIRST_NO_SPELL を定義して使用する。

Change Summary

差異

--- a/src/player/player-class.h
+++ b/src/player/player-class.h
@@ -7,6 +7,9 @@
77 #include "system/angband.h"
88 #include "spell/technic-info-table.h"
99
10+/** m_info.txtでMPの無い職業に設定される */
11+#define SPELL_FIRST_NO_SPELL 99
12+
1013 /*
1114 * Information about the player's "magic"
1215 *
--- a/src/player/player-status.c
+++ b/src/player/player-status.c
@@ -893,7 +893,7 @@ static void calc_spells(player_type *creature_ptr)
893893 */
894894 static void calc_mana(player_type *creature_ptr)
895895 {
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)
897897 return;
898898
899899 int levels;
--- 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)
140140 {
141141 char tmp[32];
142142 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)
144144 return;
145145
146146 put_str(_("MP", "SP"), ROW_CURSP, COL_CURSP);
Show on old repository browser