From b5e4ab5573ec1d8495e596bfa6c73d3f6bf9aecd Mon Sep 17 00:00:00 2001 From: deskull Date: Mon, 8 Jul 2019 12:14:56 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20wield=5Fall()=20=E3=81=AB?= =?utf8?q?=20player=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92=E8=BF=BD?= =?utf8?q?=E5=8A=A0=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/birth.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/birth.c b/src/birth.c index 493a6f472..5fa7d6ad3 100644 --- a/src/birth.c +++ b/src/birth.c @@ -1950,10 +1950,9 @@ static void init_turn(player_type *creature_ptr) /*! * @brief 所持状態にあるアイテムの中から一部枠の装備可能なものを装備させる。 - * @details アンデッド系種族は開始時刻を夜からにする。 * @return なし */ -static void wield_all(void) +static void wield_all(player_type *creature_ptr) { object_type *o_ptr; object_type *i_ptr; @@ -1965,7 +1964,7 @@ static void wield_all(void) /* Scan through the slots backwards */ for (item = INVEN_PACK - 1; item >= 0; item--) { - o_ptr = &p_ptr->inventory_list[item]; + o_ptr = &creature_ptr->inventory_list[item]; /* Skip non-objects */ if (!o_ptr->k_idx) continue; @@ -1974,7 +1973,7 @@ static void wield_all(void) slot = wield_slot(o_ptr); if (slot < INVEN_RARM) continue; if (slot == INVEN_LITE) continue; /* Does not wield toaches because buys a lantern soon */ - if (p_ptr->inventory_list[slot].k_idx) continue; + if (creature_ptr->inventory_list[slot].k_idx) continue; i_ptr = &object_type_body; object_copy(i_ptr, o_ptr); @@ -1994,12 +1993,12 @@ static void wield_all(void) floor_item_optimize(0 - item); } - o_ptr = &p_ptr->inventory_list[slot]; + o_ptr = &creature_ptr->inventory_list[slot]; object_copy(o_ptr, i_ptr); - p_ptr->total_weight += i_ptr->weight; + creature_ptr->total_weight += i_ptr->weight; /* Increment the equip counter by hand */ - p_ptr->equip_cnt++; + creature_ptr->equip_cnt++; } return; @@ -2225,7 +2224,7 @@ static void add_outfit(object_type *o_ptr) autopick_alter_item(slot, FALSE); /* Now try wielding everything */ - wield_all(); + wield_all(p_ptr); } -- 2.11.0