OSDN Git Service

[Refactor] #37353 object-ego.c/h を作成して関連構造体と変数を移動.
[hengband/hengband.git] / src / load.c
index 12bd3b0..0db32b0 100644 (file)
  */
 
 #include "angband.h"
-#include "generate.h"
+#include "util.h"
+#include "bldg.h"
+
+#include "dungeon.h"
+#include "feature.h"
+#include "floor-generate.h"
 #include "trap.h"
 #include "mutation.h"
 #include "monster.h"
 
 #include "floor-save.h"
 #include "floor.h"
+#include "grid.h"
+
+#include "cmd-pet.h"
+#include "dungeon-file.h"
+#include "files.h"
+#include "player-skill.h"
+#include "player-class.h"
+#include "world.h"
+#include "objectkind.h"
+#include "object-ego.h"
 
 
 /*
@@ -1287,7 +1302,7 @@ static void rd_lore(MONRACE_IDX r_idx)
 }
 
 /*!
- * @brief 店置きのアイテムオブジェクトを読み込む / Add the item "o_ptr" to the inventory of the "Home"
+ * @brief 店置きのアイテムオブジェクトを読み込む / Add the item "o_ptr" to the p_ptr->inventory_list of the "Home"
  * @param st_ptr 店舗の参照ポインタ
  * @param o_ptr アイテムオブジェクト参照ポインタ
  * @return なし
@@ -1913,7 +1928,7 @@ static void rd_extra(void)
 
        if (z_older_than(10, 0, 3))
        {
-               battle_monsters();
+               update_gambling_monsters();
        }
        else
        {
@@ -2234,8 +2249,8 @@ static void rd_extra(void)
 
 
        /* Hack -- the two "special seeds" */
-       rd_u32b(&seed_flavor);
-       rd_u32b(&seed_town);
+       rd_u32b(&current_world_ptr->seed_flavor);
+       rd_u32b(&current_world_ptr->seed_town);
 
 
        /* Special stuff */
@@ -2379,16 +2394,16 @@ static void rd_extra(void)
 
 
 /*!
- * @brief プレイヤーの所持品情報を読み込む / Read the player inventory
+ * @brief プレイヤーの所持品情報を読み込む / Read the player p_ptr->inventory_list
  * @return なし
  * @details
- * Note that the inventory changed in Angband 2.7.4.  Two extra
+ * Note that the p_ptr->inventory_list changed in Angband 2.7.4.  Two extra
  * pack slots were added and the equipment was rearranged.  Note
  * that these two features combine when parsing old save-files, in
  * which items from the old "aux" slot are "carried", perhaps into
- * one of the two new "inventory" slots.
+ * one of the two new "p_ptr->inventory_list" slots.
  *
- * Note that the inventory is "re-sorted" later by "dungeon()".
+ * Note that the p_ptr->inventory_list is "re-sorted" later by "dungeon()".
  */
 static errr rd_inventory(void)
 {
@@ -2401,8 +2416,8 @@ static errr rd_inventory(void)
        p_ptr->total_weight = 0;
 
        /* No items */
-       inven_cnt = 0;
-       equip_cnt = 0;
+       p_ptr->inven_cnt = 0;
+       p_ptr->equip_cnt = 0;
 
        /* Read until done */
        while (1)
@@ -2427,38 +2442,38 @@ static errr rd_inventory(void)
                if (n >= INVEN_RARM)
                {
                        q_ptr->marked |= OM_TOUCHED;
-                       object_copy(&inventory[n], q_ptr);
+                       object_copy(&p_ptr->inventory_list[n], q_ptr);
 
                        /* Add the weight */
                        p_ptr->total_weight += (q_ptr->number * q_ptr->weight);
 
                        /* One more item */
-                       equip_cnt++;
+                       p_ptr->equip_cnt++;
                }
 
                /* Warning -- backpack is full */
-               else if (inven_cnt == INVEN_PACK)
+               else if (p_ptr->inven_cnt == INVEN_PACK)
                {
-                       note(_("持ち物の中のアイテムが多すぎる!", "Too many items in the inventory!"));
+                       note(_("持ち物の中のアイテムが多すぎる!", "Too many items in the p_ptr->inventory_list!"));
 
                        /* Fail */
                        return (54);
                }
 
-               /* Carry inventory */
+               /* Carry p_ptr->inventory_list */
                else
                {
                        /* Get a slot */
                        n = slot++;
 
                        q_ptr->marked |= OM_TOUCHED;
-                       object_copy(&inventory[n], q_ptr);
+                       object_copy(&p_ptr->inventory_list[n], q_ptr);
 
                        /* Add the weight */
                        p_ptr->total_weight += (q_ptr->number * q_ptr->weight);
 
                        /* One more item */
-                       inven_cnt++;
+                       p_ptr->inven_cnt++;
                }
        }
 
@@ -2978,7 +2993,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        u32b tmp32u;
        u16b limit;
 
-       cave_template_type *templates;
+       grid_template_type *templates;
 
 
        /*** Wipe all current_floor_ptr->grid_array ***/
@@ -3050,12 +3065,12 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        rd_u16b(&limit);
 
        /* Allocate the "template" array */
-       C_MAKE(templates, limit, cave_template_type);
+       C_MAKE(templates, limit, grid_template_type);
 
        /* Read the templates */
        for (i = 0; i < limit; i++)
        {
-               cave_template_type *ct_ptr = &templates[i];
+               grid_template_type *ct_ptr = &templates[i];
 
                /* Read it */
                rd_u16b(&tmp16u);
@@ -3151,7 +3166,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        }
 
        /* Free the "template" array */
-       C_KILL(templates, limit, cave_template_type);
+       C_KILL(templates, limit, grid_template_type);
 
 
        /*** Objects ***/
@@ -3843,10 +3858,10 @@ static errr rd_savefile_new_aux(void)
        }
 
 
-       /* Read the inventory */
+       /* Read the p_ptr->inventory_list */
        if (rd_inventory())
        {
-               note(_("持ち物情報を読み込むことができません", "Unable to read inventory"));
+               note(_("持ち物情報を読み込むことができません", "Unable to read p_ptr->inventory_list"));
                return (21);
        }