OSDN Git Service

[Refactor] #38997 melee1.c、grid.c、load.c、save.c 内変数参照修正 / Fixed variable references...
[hengband/hengband.git] / src / load.c
index 5187c60..d9c76c3 100644 (file)
@@ -2429,7 +2429,7 @@ static errr rd_inventory(void)
        C_MAKE(p_ptr->inventory_list, INVEN_TOTAL, object_type);
 
        /* Read until done */
-       while (1)
+       while (TRUE)
        {
                u16b n;
 
@@ -2560,12 +2560,13 @@ static void rd_messages(void)
 
 /*!
  * @brief メッセージログを読み込む / Read the dungeon (old method)
+ * @param creature_ptr プレーヤーへの参照ポインタ
  * @return なし
  * @details
  * The monsters/objects must be loaded in the same order
  * that they were stored, since the actual indexes matter.
  */
-static errr rd_dungeon_old(floor_type *floor_ptr)
+static errr rd_dungeon_old(player_type *creature_ptr)
 {
        int i, y, x;
        int ymax, xmax;
@@ -2580,12 +2581,13 @@ static errr rd_dungeon_old(floor_type *floor_ptr)
 
        /* Header info */
        rd_s16b(&tmp16s);
+       floor_type *floor_ptr = creature_ptr->current_floor_ptr;
        floor_ptr->dun_level = (DEPTH)tmp16s;
-       if (z_older_than(10, 3, 8)) p_ptr->dungeon_idx = DUNGEON_ANGBAND;
+       if (z_older_than(10, 3, 8)) creature_ptr->dungeon_idx = DUNGEON_ANGBAND;
        else
        { 
                rd_byte(&tmp8u);
-               p_ptr->dungeon_idx = (IDX)tmp8u;
+               creature_ptr->dungeon_idx = (IDX)tmp8u;
        }
 
        /* Set the base level for old versions */
@@ -2597,10 +2599,10 @@ static errr rd_dungeon_old(floor_type *floor_ptr)
        rd_s16b(&tmp16s);
        floor_ptr->num_repro = (MONSTER_NUMBER)tmp16s;
        rd_s16b(&tmp16s);
-       p_ptr->y = (POSITION)tmp16s;
+       creature_ptr->y = (POSITION)tmp16s;
        rd_s16b(&tmp16s);
-       p_ptr->x = (POSITION)tmp16s;
-       if (z_older_than(10, 3, 13) && !floor_ptr->dun_level && !floor_ptr->inside_arena) {p_ptr->y = 33;p_ptr->x = 131;}
+       creature_ptr->x = (POSITION)tmp16s;
+       if (z_older_than(10, 3, 13) && !floor_ptr->dun_level && !floor_ptr->inside_arena) { creature_ptr->y = 33; creature_ptr->x = 131;}
        rd_s16b(&tmp16s);
        floor_ptr->height = (POSITION)tmp16s;
        rd_s16b(&tmp16s);
@@ -2804,7 +2806,7 @@ static errr rd_dungeon_old(floor_type *floor_ptr)
                        {
                                g_ptr->info &= ~CAVE_TRAP;
                                g_ptr->mimic = g_ptr->feat;
-                               g_ptr->feat = choose_random_trap(floor_ptr);
+                               g_ptr->feat = choose_random_trap(creature_ptr);
                        }
 
                        /* Another hidden trap */
@@ -3271,13 +3273,13 @@ static errr rd_dungeon(player_type *player_ptr)
        byte num;
        int i;
 
-       /* Initialize saved_floors array and temporal files */
+       /* Initialize saved_floors array and temporary files */
        init_saved_floors(player_ptr, FALSE);
 
        /* Older method */
        if (h_older_than(1, 5, 0, 0))
        {
-               err = rd_dungeon_old(player_ptr->current_floor_ptr);
+               err = rd_dungeon_old(player_ptr);
 
                /* Prepare floor_id of current floor */
                if (player_ptr->dungeon_idx)
@@ -3332,7 +3334,7 @@ static errr rd_dungeon(player_type *player_ptr)
                }
 
 
-               /* Move saved floors data to temporal files */
+               /* Move saved floors data to temporary files */
                for (i = 0; i < num; i++)
                {
                        saved_floor_type *sf_ptr = &saved_floors[i];
@@ -3350,14 +3352,14 @@ static errr rd_dungeon(player_type *player_ptr)
                        /* Error? */
                        if (err) break;
 
-                       /* Re-save as temporal saved floor file */
+                       /* Re-save as temporary saved floor file */
                        if (!save_floor(sf_ptr, SLF_SECOND)) err = 182;
 
                        /* Error? */
                        if (err) break;
                }
 
-               /* Finally load current floor data from temporal file */
+               /* Finally load current floor data from temporary file */
                if (!err)
                {
                        if (!load_floor(player_ptr, get_sf_ptr(player_ptr->floor_id), SLF_SECOND)) err = 183;
@@ -3389,7 +3391,7 @@ static errr rd_dungeon(player_type *player_ptr)
                break;
 
        case 182:
-               note(_("テンポラリ・ファイルを作成できません!", "Failed to make temporal files!"));
+               note(_("テンポラリ・ファイルを作成できません!", "Failed to make temporary files!"));
                break;
 
        case 183:
@@ -4050,7 +4052,7 @@ static bool load_floor_aux(player_type *player_ptr, saved_floor_type *sf_ptr)
        x_check = 0L;
 
        /* Set the version number to current version */
-       /* Never load old temporal files */
+       /* Never load old temporary files */
        current_world_ptr->h_ver_extra = H_VER_EXTRA;
        current_world_ptr->h_ver_patch = H_VER_PATCH;
        current_world_ptr->h_ver_minor = H_VER_MINOR;
@@ -4090,7 +4092,7 @@ static bool load_floor_aux(player_type *player_ptr, saved_floor_type *sf_ptr)
 
 
 /*!
- * @brief 一時保存フロア情報を読み込む / Attempt to load the temporally saved-floor data
+ * @brief 一時保存フロア情報を読み込む / Attempt to load the temporarily saved-floor data
  * @param player_ptr プレーヤーへの参照ポインタ
  * @param sf_ptr 保存フロア読み込み先
  * @param mode オプション
@@ -4113,7 +4115,7 @@ bool load_floor(player_type *player_ptr, saved_floor_type *sf_ptr, BIT_FLAGS mod
        byte old_kanji_code = kanji_code;
 
        /*
-        * Temporal files are always written in system depended kanji
+        * Temporary files are always written in system depended kanji
         * code.
         */
 #ifdef JP