OSDN Git Service

[Refactor] #38852 更新処理タイミング再調整。 / Readjust update timing.
[hengband/hengband.git] / src / load.c
index 460dc54..f9af9ec 100644 (file)
@@ -37,7 +37,7 @@
  * the existing "number of turns to protect for", and where each hit
  * by a monster will reduce the shield by that amount.
  *
- * XXX XXX XXX
+ * 
  */
 
 #include "angband.h"
@@ -347,7 +347,6 @@ static void rd_item_old(object_type *o_ptr)
        /* Kind */
        rd_s16b(&o_ptr->k_idx);
 
-       /* Location */
        rd_byte(&tmp8u);
        o_ptr->iy = (POSITION)tmp8u;
        rd_byte(&tmp8u);
@@ -628,7 +627,6 @@ static void rd_item(object_type *o_ptr)
        /* Kind */
        rd_s16b(&o_ptr->k_idx);
 
-       /* Location */
        rd_byte(&tmp8u);
        o_ptr->iy = (POSITION)tmp8u;
        rd_byte(&tmp8u);
@@ -1401,11 +1399,7 @@ static errr rd_store(int town_number, int store_number)
        {
                object_type forge;
                object_type *q_ptr;
-
-               /* Get local object */
                q_ptr = &forge;
-
-               /* Wipe the object */
                object_wipe(q_ptr);
 
                /* Read the item */
@@ -1475,21 +1469,15 @@ static void rd_randomizer(void)
 static void rd_options(void)
 {
        int i, n;
-
        byte b;
-
        u16b c;
 
        BIT_FLAGS flag[8];
        BIT_FLAGS mask[8];
 
-
-       /*** Oops ***/
-
        /* Ignore old options */
        strip_bytes(16);
 
-
        /*** Special info */
 
        /* Read "delay_factor" */
@@ -1511,7 +1499,6 @@ static void rd_options(void)
                mana_warn = b;
        }
 
-
        /*** Cheating options ***/
 
        rd_u16b(&c);
@@ -1643,7 +1630,7 @@ static void rd_options(void)
  * @brief ダミー情報スキップ / Hack -- strip the "ghost" info
  * @return なし
  * @details
- * XXX XXX XXX This is such a nasty hack it hurts.
+ * This is such a nasty hack it hurts.
  */
 static void rd_ghost(void)
 {
@@ -1674,9 +1661,12 @@ static void load_quick_start(void)
        }
 
        rd_byte(&previous_char.psex);
-       rd_byte(&previous_char.prace);
-       rd_byte(&previous_char.pclass);
-       rd_byte(&previous_char.pseikaku);
+       rd_byte(&tmp8u);
+       previous_char.prace = (RACE_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       previous_char.pclass = (CLASS_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       previous_char.pseikaku = (CHARACTER_IDX)tmp8u;
        rd_byte(&tmp8u);
        previous_char.realm1 = (REALM_IDX)tmp8u;
        rd_byte(&tmp8u);
@@ -1744,15 +1734,18 @@ static void rd_extra(void)
        }
 
        /* Class/Race/Seikaku/Gender/Spells */
-       rd_byte(&p_ptr->prace);
-       rd_byte(&p_ptr->pclass);
-       rd_byte(&p_ptr->pseikaku);
+       rd_byte(&tmp8u);
+       p_ptr->prace = (RACE_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       p_ptr->pclass = (CLASS_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       p_ptr->pseikaku = (CHARACTER_IDX)tmp8u;
        rd_byte(&p_ptr->psex);
        rd_byte(&tmp8u);
        p_ptr->realm1 = (REALM_IDX)tmp8u;
        rd_byte(&tmp8u);
        p_ptr->realm2 = (REALM_IDX)tmp8u;
-       rd_byte(&tmp8u); /* oops */
+       rd_byte(&tmp8u);
 
        if (z_older_than(10, 4, 4))
        {
@@ -1777,8 +1770,7 @@ static void rd_extra(void)
        for (i = 0; i < 6; i++) rd_s16b(&p_ptr->stat_max_max[i]);
        for (i = 0; i < 6; i++) rd_s16b(&p_ptr->stat_cur[i]);
 
-       strip_bytes(24); /* oops */
-
+       strip_bytes(24);
        rd_s32b(&p_ptr->au);
 
        rd_s32b(&p_ptr->max_exp);
@@ -1844,7 +1836,8 @@ static void rd_extra(void)
        }
        else
        {
-               rd_byte(&p_ptr->start_race);
+               rd_byte(&tmp8u);
+               p_ptr->start_race = (RACE_IDX)tmp8u;
                rd_s32b(&tmp32s);
                p_ptr->old_race1 = (BIT_FLAGS)tmp32s;
                rd_s32b(&tmp32s);
@@ -2016,7 +2009,7 @@ static void rd_extra(void)
                }
        }
 
-       /* Repair maximum player level XXX XXX XXX */
+       /* Repair maximum player level */
        if (p_ptr->max_plv < p_ptr->lev) p_ptr->max_plv = p_ptr->lev;
 
        /* More info */
@@ -2210,7 +2203,7 @@ static void rd_extra(void)
        rd_byte(&tmp8u);
        p_ptr->autopick_autoregister = tmp8u ? TRUE : FALSE;
 
-       rd_byte(&tmp8u); /* oops */
+       rd_byte(&tmp8u);
        rd_byte(&tmp8u);
        p_ptr->action = (ACTION_IDX)tmp8u;
        if (!z_older_than(10, 4, 3))
@@ -2409,11 +2402,7 @@ static errr rd_inventory(void)
 
                /* Nope, we reached the end */
                if (n == 0xFFFF) break;
-
-               /* Get local object */
                q_ptr = &forge;
-
-               /* Wipe the object */
                object_wipe(q_ptr);
 
                /* Read the item */
@@ -2441,7 +2430,6 @@ static errr rd_inventory(void)
                /* Warning -- backpack is full */
                else if (inven_cnt == INVEN_PACK)
                {
-                       /* Oops */
                        note(_("持ち物の中のアイテムが多すぎる!", "Too many items in the inventory!"));
 
                        /* Fail */
@@ -2859,7 +2847,6 @@ static errr rd_dungeon_old(void)
                /* Get a new record */
                o_idx = o_pop();
 
-               /* Oops */
                if (i != o_idx)
                {
                        note(format(_("アイテム配置エラー (%d <> %d)", "Object allocation error (%d <> %d)"), i, o_idx));
@@ -2874,7 +2861,7 @@ static errr rd_dungeon_old(void)
                rd_item(o_ptr);
 
 
-               /* XXX XXX XXX XXX XXX */
+               /* XXX XXX */
 
                /* Monster */
                if (o_ptr->held_m_idx)
@@ -2927,7 +2914,6 @@ static errr rd_dungeon_old(void)
                /* Get a new record */
                m_idx = m_pop();
 
-               /* Oops */
                if (i != m_idx)
                {
                        note(format(_("モンスター配置エラー (%d <> %d)", "Monster allocation error (%d <> %d)"), i, m_idx));
@@ -3186,7 +3172,6 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
                /* Get a new record */
                o_idx = o_pop();
 
-               /* Oops */
                if (i != o_idx) return 152;
 
                /* Acquire place */
@@ -3244,7 +3229,6 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
                /* Get a new record */
                m_idx = m_pop();
 
-               /* Oops */
                if (i != m_idx) return 162;
 
 
@@ -4038,11 +4022,7 @@ errr rd_savefile_new(void)
 
        /* Check for errors */
        if (ferror(fff)) err = -1;
-
-       /* Close the file */
        my_fclose(fff);
-
-       /* Result */
        return (err);
 }
 
@@ -4188,8 +4168,6 @@ bool load_floor(saved_floor_type *sf_ptr, BIT_FLAGS mode)
 
                /* Check for errors */
                if (ferror(fff)) ok = FALSE;
-
-               /* Close the file */
                my_fclose(fff);
 
                /* Grab permissions */
@@ -4218,7 +4196,5 @@ bool load_floor(saved_floor_type *sf_ptr, BIT_FLAGS mode)
 
        /* Restore old knowledge */
        kanji_code = old_kanji_code;
-
-       /* Result */
        return ok;
 }