• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision3718ec0e5b3c1e1c287d75ab4c2324bd1c959aae (tree)
Time2019-06-20 21:19:56
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 do_cmd_open() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -818,7 +818,7 @@ static bool do_cmd_open_aux(POSITION y, POSITION x)
818818 * @details
819819 * Unlocking a locked door/chest is worth one experience point.
820820 */
821-void do_cmd_open(void)
821+void do_cmd_open(player_type *creature_ptr)
822822 {
823823 POSITION y, x;
824824 DIRECTION dir;
@@ -826,9 +826,9 @@ void do_cmd_open(void)
826826
827827 bool more = FALSE;
828828
829- if (p_ptr->wild_mode) return;
829+ if (creature_ptr->wild_mode) return;
830830
831- if (p_ptr->special_defense & KATA_MUSOU)
831+ if (creature_ptr->special_defense & KATA_MUSOU)
832832 {
833833 set_action(ACTION_NONE);
834834 }
@@ -842,7 +842,7 @@ void do_cmd_open(void)
842842 num_doors = count_dt(&y, &x, is_closed_door, FALSE);
843843
844844 /* Count chests (locked) */
845- num_chests = count_chests(p_ptr, &y, &x, FALSE);
845+ num_chests = count_chests(creature_ptr, &y, &x, FALSE);
846846
847847 /* See if only one target */
848848 if (num_doors || num_chests)
@@ -858,7 +858,7 @@ void do_cmd_open(void)
858858 {
859859 /* Set repeat count */
860860 command_rep = command_arg - 1;
861- p_ptr->redraw |= (PR_STATE);
861+ creature_ptr->redraw |= (PR_STATE);
862862
863863 /* Cancel the arg */
864864 command_arg = 0;
@@ -871,8 +871,8 @@ void do_cmd_open(void)
871871 grid_type *g_ptr;
872872
873873 /* Get requested location */
874- y = p_ptr->y + ddy[dir];
875- x = p_ptr->x + ddx[dir];
874+ y = creature_ptr->y + ddy[dir];
875+ x = creature_ptr->x + ddx[dir];
876876
877877 /* Get requested grid */
878878 g_ptr = &current_floor_ptr->grid_array[y][x];
@@ -890,9 +890,9 @@ void do_cmd_open(void)
890890 }
891891
892892 /* Monster in the way */
893- else if (g_ptr->m_idx && p_ptr->riding != g_ptr->m_idx)
893+ else if (g_ptr->m_idx && creature_ptr->riding != g_ptr->m_idx)
894894 {
895- take_turn(p_ptr, 100);
895+ take_turn(creature_ptr, 100);
896896 msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
897897 py_attack(y, x, 0);
898898 }
--- a/src/cmd-basic.h
+++ b/src/cmd-basic.h
@@ -12,7 +12,7 @@ extern void forget_travel_flow(void);
1212 extern void do_cmd_go_up(player_type *creature_ptr);
1313 extern void do_cmd_go_down(player_type *creature_ptr);
1414 extern void do_cmd_search(player_type *creature_ptr);
15-extern void do_cmd_open(void);
15+extern void do_cmd_open(player_type *creature_ptr);
1616 extern void do_cmd_close(void);
1717 extern void do_cmd_tunnel(void);
1818 extern void do_cmd_disarm(void);
--- a/src/core.c
+++ b/src/core.c
@@ -3783,7 +3783,7 @@ static void process_command(void)
37833783 /* Open a door or chest */
37843784 case 'o':
37853785 {
3786- do_cmd_open();
3786+ do_cmd_open(p_ptr);
37873787 break;
37883788 }
37893789
Show on old repository browser