1 #include "load/inventory-loader.h"
2 #include "inventory/inventory-slot-types.h"
3 #include "load/item-loader.h"
4 #include "load/load-util.h"
5 #include "object/object-generator.h"
6 #include "object/object-mark-types.h"
7 #include "system/object-type-definition.h"
10 * @brief プレイヤーの所持品情報を読み込む / Read the player inventory
11 * @param player_ptr プレーヤーへの参照ポインタ
14 * Note that the inventory changed in Angband 2.7.4. Two extra
15 * pack slots were added and the equipment was rearranged. Note
16 * that these two features combine when parsing old save-files, in
17 * which items from the old "aux" slot are "carried", perhaps into
18 * one of the two new "inventory" slots.
20 * Note that the inventory is "re-sorted" later by "dungeon()".
22 static errr rd_inventory(player_type *player_ptr)
24 player_ptr->inven_cnt = 0;
25 player_ptr->equip_cnt = 0;
27 if (player_ptr->inventory_list != NULL)
28 C_WIPE(player_ptr->inventory_list, INVEN_TOTAL, object_type);
29 C_MAKE(player_ptr->inventory_list, INVEN_TOTAL, object_type);
43 rd_item(player_ptr, q_ptr);
47 if (n >= INVEN_MAIN_HAND) {
48 q_ptr->marked |= OM_TOUCHED;
49 object_copy(&player_ptr->inventory_list[n], q_ptr);
50 player_ptr->equip_cnt++;
54 if (player_ptr->inven_cnt == INVEN_PACK) {
55 load_note(_("持ち物の中のアイテムが多すぎる!", "Too many items in the inventory"));
60 q_ptr->marked |= OM_TOUCHED;
61 object_copy(&player_ptr->inventory_list[n], q_ptr);
62 player_ptr->inven_cnt++;
68 errr load_inventory(player_type *creature_ptr)
71 for (int i = 0; i < 64; i++) {
73 creature_ptr->spell_order[i] = (SPELL_IDX)tmp8u;
76 if (!rd_inventory(creature_ptr))
79 load_note(_("持ち物情報を読み込むことができません", "Unable to read inventory"));