OSDN Git Service

[Refactor] #38995 world_type 構造体に kubi_r_idx を bounty_r_idx に改名して取り込む。 / Move kubi_r...
[hengband/hengband.git] / src / save.c
index 61e06fc..34be718 100644 (file)
@@ -664,7 +664,7 @@ static void wr_extra(void)
 
        for (i = 0; i < MAX_KUBI; i++)
        {
-               wr_s16b(kubi_r_idx[i]);
+               wr_s16b(current_world_ptr->bounty_r_idx[i]);
        }
 
        for (i = 0; i < 4; i++)
@@ -820,15 +820,15 @@ static void wr_extra(void)
        wr_byte(p_ptr->feeling);
 
        /* Turn when level began */
-       wr_s32b(old_turn);
+       wr_s32b(current_floor_ptr->generated_turn);
 
        /* Turn of last "feeling" */
        wr_s32b(p_ptr->feeling_turn);
 
-       /* Current turn */
-       wr_s32b(turn);
+       /* Current current_world_ptr->game_turn */
+       wr_s32b(current_world_ptr->game_turn);
 
-       wr_s32b(dungeon_turn);
+       wr_s32b(current_world_ptr->dungeon_turn);
 
        wr_s32b(old_battle);
 
@@ -940,11 +940,11 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
        }
 
        wr_u16b((u16b)current_floor_ptr->base_level);
-       wr_u16b((s16b)num_repro);
+       wr_u16b((s16b)current_floor_ptr->num_repro);
        wr_u16b((u16b)p_ptr->y);
        wr_u16b((u16b)p_ptr->x);
-       wr_u16b((u16b)cur_hgt);
-       wr_u16b((u16b)cur_wid);
+       wr_u16b((u16b)current_floor_ptr->height);
+       wr_u16b((u16b)current_floor_ptr->width);
        wr_byte(p_ptr->feeling);
 
 
@@ -969,9 +969,9 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
        C_MAKE(templates, max_num_temp, cave_template_type);
 
        /* Extract template array */
-       for (y = 0; y < cur_hgt; y++)
+       for (y = 0; y < current_floor_ptr->height; y++)
        {
-               for (x = 0; x < cur_wid; x++)
+               for (x = 0; x < current_floor_ptr->width; x++)
                {
                        grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
 
@@ -1049,9 +1049,9 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
        prev_u16b = 0;
 
        /* Dump the current_floor_ptr->grid_array */
-       for (y = 0; y < cur_hgt; y++)
+       for (y = 0; y < current_floor_ptr->height; y++)
        {
-               for (x = 0; x < cur_wid; x++)
+               for (x = 0; x < current_floor_ptr->width; x++)
                {
                        grid_type *g_ptr = &current_floor_ptr->grid_array[y][x];
 
@@ -1119,7 +1119,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
        /* Dump the objects */
        for (i = 1; i < o_max; i++)
        {
-               object_type *o_ptr = &o_list[i];
+               object_type *o_ptr = &current_floor_ptr->o_list[i];
 
                /* Dump it */
                wr_item(o_ptr);
@@ -1134,7 +1134,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
        /* Dump the monsters */
        for (i = 1; i < m_max; i++)
        {
-               monster_type *m_ptr = &m_list[i];
+               monster_type *m_ptr = &current_floor_ptr->m_list[i];
 
                /* Dump it */
                wr_monster(m_ptr);
@@ -1411,13 +1411,13 @@ static bool wr_savefile_new(void)
        wr_byte(p_ptr->wild_mode);
        wr_byte(ambush_flag);
 
-       wr_s32b(max_wild_x);
-       wr_s32b(max_wild_y);
+       wr_s32b(current_world_ptr->max_wild_x);
+       wr_s32b(current_world_ptr->max_wild_y);
 
        /* Dump the wilderness seeds */
-       for (i = 0; i < max_wild_x; i++)
+       for (i = 0; i < current_world_ptr->max_wild_x; i++)
        {
-               for (j = 0; j < max_wild_y; j++)
+               for (j = 0; j < current_world_ptr->max_wild_y; j++)
                {
                        wr_u32b(wilderness[j][i].seed);
                }
@@ -1771,7 +1771,7 @@ bool load_player(void)
 
 
        /* Paranoia */
-       turn = 0;
+       current_world_ptr->game_turn = 0;
 
        /* Paranoia */
        p_ptr->is_dead = FALSE;
@@ -1891,8 +1891,8 @@ bool load_player(void)
        /* Paranoia */
        if (!err)
        {
-               /* Invalid turn */
-               if (!turn) err = -1;
+               /* Invalid current_world_ptr->game_turn */
+               if (!current_world_ptr->game_turn) err = -1;
 
                /* Message (below) */
                if (err) what = _("セーブファイルが壊れています", "Broken savefile");