• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision07c3425eb1fd003f42ab0d0a77f0ea5a2fe80a16 (tree)
Time2019-01-10 21:54:54
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #38827 SPEEDの型定義をs16bに拡張。 / Change typedef of SPEED to s16b.

Change Summary

Incremental Difference

--- a/src/defines.h
+++ b/src/defines.h
@@ -637,7 +637,7 @@
637637 #define REALM_DEATH 5
638638 #define REALM_TRUMP 6
639639 #define REALM_ARCANE 7
640-#define REALM_CRAFT 8
640+#define REALM_CRAFT 8
641641 #define REALM_DAEMON 9
642642 #define REALM_CRUSADE 10
643643 #define MAX_MAGIC 10
--- a/src/h-type.h
+++ b/src/h-type.h
@@ -173,7 +173,7 @@ typedef s16b ACTION_ENERGY; /*!< ゲーム中の行動エネルギー型を定
173173 typedef s16b ARMOUR_CLASS; /*!< ゲーム中の行動アーマークラス型を定義 */
174174 typedef s16b TIME_EFFECT; /*!< ゲーム中の時限期間の型を定義 */
175175 typedef byte DISCOUNT_RATE; /*!< ゲーム中の値引き率の型を定義 */
176-typedef byte SPEED; /*!< ゲーム中の加速値の型定義 */
176+typedef s16b SPEED; /*!< ゲーム中の加速値の型定義 */
177177
178178 /*!
179179 * @var typedef s16b ENEGRY
--- a/src/load.c
+++ b/src/load.c
@@ -871,7 +871,10 @@ static void rd_monster_old(monster_type *m_ptr)
871871 }
872872
873873 rd_s16b(&m_ptr->mtimed[MTIMED_CSLEEP]);
874- rd_byte(&m_ptr->mspeed);
874+
875+ rd_byte(&tmp8u);
876+ m_ptr->mspeed = tmp8u;
877+
875878 if (z_older_than(10, 4, 2))
876879 {
877880 rd_byte(&tmp8u);
@@ -1025,7 +1028,8 @@ static void rd_monster(monster_type *m_ptr)
10251028 if (flags & SAVE_MON_CSLEEP) rd_s16b(&m_ptr->mtimed[MTIMED_CSLEEP]);
10261029 else m_ptr->mtimed[MTIMED_CSLEEP] = 0;
10271030
1028- rd_byte(&m_ptr->mspeed);
1031+ rd_byte(&tmp8u);
1032+ m_ptr->mspeed = tmp8u;
10291033
10301034 rd_s16b(&m_ptr->energy_need);
10311035
--- a/src/save.c
+++ b/src/save.c
@@ -259,7 +259,7 @@ static void wr_monster(monster_type *m_ptr)
259259 if (flags & SAVE_MON_SUB_ALIGN) wr_byte(m_ptr->sub_align);
260260 if (flags & SAVE_MON_CSLEEP) wr_s16b(m_ptr->mtimed[MTIMED_CSLEEP]);
261261
262- wr_byte(m_ptr->mspeed);
262+ wr_byte((byte)m_ptr->mspeed);
263263 wr_s16b(m_ptr->energy_need);
264264
265265 if (flags & SAVE_MON_FAST)
Show on old repository browser