OSDN Git Service

#37287 #37353 (2.2.0.89) QUEST_IDX 型を定義し、型の置換を継続中。 / Define QUEST_IDX, ongoing type...
authorDeskull <desull@users.sourceforge.jp>
Sat, 7 Oct 2017 15:36:24 +0000 (00:36 +0900)
committerDeskull <desull@users.sourceforge.jp>
Sat, 7 Oct 2017 15:36:24 +0000 (00:36 +0900)
src/h-type.h
src/load.c
src/types.h

index 446e6a2..90619c0 100644 (file)
@@ -112,6 +112,7 @@ typedef s16b DUNGEON_IDX;   /*!< ゲーム中のダンジョンID型を定義 */
 typedef s16b REALM_IDX;                /*!< ゲーム中の魔法領域ID型を定義 */
 typedef s16b ARTIFACT_IDX;     /*!< ゲーム中のアーティファクトID型を定義 */
 typedef s16b VIRTUES_IDX;      /*!< ゲーム中の徳ID型を定義 */
+typedef s16b QUEST_IDX;                /*!< ゲーム中のクエストID型を定義 */
 
 typedef s32b POSITION;         /*!< ゲーム中の座標型を定義 */
 typedef s32b HIT_POINT;                /*!< ゲーム中のHP/ダメージ型を定義 */
index 7572bd4..6a79fe9 100644 (file)
@@ -1653,8 +1653,10 @@ static void load_quick_start(void)
        rd_byte(&previous_char.prace);
        rd_byte(&previous_char.pclass);
        rd_byte(&previous_char.pseikaku);
-       rd_byte(&previous_char.realm1);
-       rd_byte(&previous_char.realm2);
+       rd_byte(&tmp8u);
+       previous_char.realm1 = (REALM_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       previous_char.realm2 = (REALM_IDX)tmp8u;
 
        rd_s16b(&previous_char.age);
        rd_s16b(&previous_char.ht);
@@ -1718,8 +1720,10 @@ static void rd_extra(void)
        rd_byte(&p_ptr->pclass);
        rd_byte(&p_ptr->pseikaku);
        rd_byte(&p_ptr->psex);
-       rd_byte(&p_ptr->realm1);
-       rd_byte(&p_ptr->realm2);
+       rd_byte(&tmp8u);
+       p_ptr->realm1 = (REALM_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       p_ptr->realm2 = (REALM_IDX)tmp8u;
        rd_byte(&tmp8u); /* oops */
 
        if (z_older_than(10, 4, 4))
@@ -2323,7 +2327,6 @@ static void rd_extra(void)
        }
        else if (z_older_than(10, 3, 10))
        {
-               s32b tmp32s;
                rd_s32b(&tmp32s);
                p_ptr->visit = 1L;
        }
@@ -3234,6 +3237,7 @@ static errr rd_dungeon(void)
 {
        errr err = 0;
        s16b tmp16s;
+       byte_hack tmp8u;
        byte num;
        int i;
 
@@ -3262,8 +3266,8 @@ static errr rd_dungeon(void)
        rd_s16b(&max_floor_id);
 
        /* Current dungeon type */
-       rd_byte(&dungeon_type);
-
+       rd_byte(&tmp8u);
+       dungeon_type = (DUNGEON_IDX)tmp8u;
 
        /* Number of the saved_floors array elements */
        rd_byte(&num);
@@ -3483,7 +3487,7 @@ static errr rd_savefile_new_aux(void)
        for (i = 0; i < tmp16u; i++)
        {
                /* Read the lore */
-               rd_lore(i);
+               rd_lore((MONRACE_IDX)i);
        }
 
        if (arg_fiddle) note(_("モンスターの思い出をロードしました", "Loaded Monster Memory"));
@@ -3805,7 +3809,8 @@ static errr rd_savefile_new_aux(void)
 
        for (i = 0; i < 64; i++)
        {
-               rd_byte(&p_ptr->spell_order[i]);
+               rd_byte(&tmp8u);
+               p_ptr->spell_order[i] = (SPELL_IDX)tmp8u;
        }
 
 
index eb46f27..27955c3 100644 (file)
@@ -991,7 +991,7 @@ struct player_type
        s16b town_num;                  /* Current town number */
        s16b arena_number;              /* monster number in arena -KMW- */
        bool inside_arena;              /* Is character inside arena? */
-       IDX inside_quest;               /* Inside quest level */
+       QUEST_IDX inside_quest;         /* Inside quest level */
        bool inside_battle;             /* Is character inside tougijou? */
 
        POSITION wilderness_x;  /* Coordinates in the wilderness */