• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision3e08bfe3b37c93c5d030905dba94610b515898ec (tree)
Time2019-08-29 23:53:40
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 verify_equip_slot() に player_type * 引数を追加. / Add player_type * argument to verify_equip_slot().

Change Summary

Incremental Difference

--- a/src/cmd/cmd-basic.c
+++ b/src/cmd/cmd-basic.c
@@ -2819,7 +2819,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
28192819 }
28202820 else if (equiped_item)
28212821 {
2822- verify_equip_slot(item);
2822+ verify_equip_slot(creature_ptr, item);
28232823 calc_android_exp(creature_ptr);
28242824 }
28252825
--- a/src/cmd/cmd-basic.h
+++ b/src/cmd/cmd-basic.h
@@ -30,4 +30,4 @@ extern bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OB
3030 extern bool easy_open_door(player_type *creature_ptr, POSITION y, POSITION x);
3131 extern bool exe_disarm(player_type *creature_ptr, POSITION y, POSITION x, DIRECTION dir);
3232
33-extern void verify_equip_slot(INVENTORY_IDX item);
33+extern void verify_equip_slot(player_type *owner_ptr, INVENTORY_IDX item);
--- a/src/cmd/cmd-item.c
+++ b/src/cmd/cmd-item.c
@@ -437,23 +437,23 @@ void do_cmd_wield(player_type *creature_ptr)
437437 * @param item 持ち替えを行いたい装備部位ID
438438 * @return なし
439439 */
440-void verify_equip_slot(INVENTORY_IDX item)
440+void verify_equip_slot(player_type *owner_ptr, INVENTORY_IDX item)
441441 {
442442 object_type *o_ptr, *new_o_ptr;
443443 GAME_TEXT o_name[MAX_NLEN];
444444
445445 if (item == INVEN_RARM)
446446 {
447- if (has_melee_weapon(p_ptr, INVEN_LARM))
447+ if (has_melee_weapon(owner_ptr, INVEN_LARM))
448448 {
449- o_ptr = &p_ptr->inventory_list[INVEN_LARM];
449+ o_ptr = &owner_ptr->inventory_list[INVEN_LARM];
450450 object_desc(o_name, o_ptr, 0);
451451
452452 if (!object_is_cursed(o_ptr))
453453 {
454- new_o_ptr = &p_ptr->inventory_list[INVEN_RARM];
454+ new_o_ptr = &owner_ptr->inventory_list[INVEN_RARM];
455455 object_copy(new_o_ptr, o_ptr);
456- p_ptr->total_weight += o_ptr->weight;
456+ owner_ptr->total_weight += o_ptr->weight;
457457 inven_item_increase(INVEN_LARM, -((int)o_ptr->number));
458458 inven_item_optimize(INVEN_LARM);
459459 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
@@ -471,19 +471,19 @@ void verify_equip_slot(INVENTORY_IDX item)
471471 }
472472 else if (item == INVEN_LARM)
473473 {
474- o_ptr = &p_ptr->inventory_list[INVEN_RARM];
474+ o_ptr = &owner_ptr->inventory_list[INVEN_RARM];
475475 if (o_ptr->k_idx) object_desc(o_name, o_ptr, 0);
476476
477- if (has_melee_weapon(p_ptr, INVEN_RARM))
477+ if (has_melee_weapon(owner_ptr, INVEN_RARM))
478478 {
479479 if (object_allow_two_hands_wielding(o_ptr) && CAN_TWO_HANDS_WIELDING())
480480 msg_format(_("%sを両手で構えた。", "You are wielding %s with both hands."), o_name);
481481 }
482- else if (!(empty_hands(p_ptr, FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
482+ else if (!(empty_hands(owner_ptr, FALSE) & EMPTY_HAND_RARM) && !object_is_cursed(o_ptr))
483483 {
484- new_o_ptr = &p_ptr->inventory_list[INVEN_LARM];
484+ new_o_ptr = &owner_ptr->inventory_list[INVEN_LARM];
485485 object_copy(new_o_ptr, o_ptr);
486- p_ptr->total_weight += o_ptr->weight;
486+ owner_ptr->total_weight += o_ptr->weight;
487487 inven_item_increase(INVEN_RARM, -((int)o_ptr->number));
488488 inven_item_optimize(INVEN_RARM);
489489 msg_format(_("%sを持ち替えた。", "You switched hand of %s."), o_name);
@@ -548,7 +548,7 @@ void do_cmd_takeoff(player_type *creature_ptr)
548548
549549 /* Take off the item */
550550 (void)inven_takeoff(item, 255);
551- verify_equip_slot(item);
551+ verify_equip_slot(creature_ptr, item);
552552 calc_android_exp(creature_ptr);
553553 creature_ptr->redraw |= (PR_EQUIPPY);
554554 }
@@ -598,7 +598,7 @@ void do_cmd_drop(player_type *creature_ptr)
598598
599599 if (item >= INVEN_RARM)
600600 {
601- verify_equip_slot(item);
601+ verify_equip_slot(creature_ptr, item);
602602 calc_android_exp(creature_ptr);
603603 }
604604
--- a/src/store.c
+++ b/src/store.c
@@ -5183,7 +5183,7 @@ static void store_sell(void)
51835183 if ((choice == 0) && (item >= INVEN_RARM))
51845184 {
51855185 calc_android_exp(p_ptr);
5186- verify_equip_slot(item);
5186+ verify_equip_slot(p_ptr, item);
51875187 }
51885188 }
51895189
Show on old repository browser