From f9879a2e32ce9f253d8da0723f08dcfc362e6ec3 Mon Sep 17 00:00:00 2001 From: deskull Date: Thu, 18 Jul 2019 00:39:05 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20do=5Fcmd=5Fopen=5Faux()=20?= =?utf8?q?=E3=81=AB=20player=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cmd-basic.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cmd-basic.c b/src/cmd-basic.c index e8fbbdcf8..4bd31770f 100644 --- a/src/cmd-basic.c +++ b/src/cmd-basic.c @@ -734,7 +734,7 @@ static int count_chests(player_type *creature_ptr, POSITION *y, POSITION *x, boo * Assume there is no monster blocking the destination * Returns TRUE if repeated commands may continue */ -static bool do_cmd_open_aux(POSITION y, POSITION x) +static bool do_cmd_open_aux(player_type *creature_ptr, POSITION y, POSITION x) { int i, j; @@ -743,7 +743,7 @@ static bool do_cmd_open_aux(POSITION y, POSITION x) feature_type *f_ptr = &f_info[g_ptr->feat]; bool more = FALSE; - take_turn(p_ptr, 100); + take_turn(creature_ptr, 100); /* Seeing true feature code (ignore mimic) */ @@ -758,11 +758,11 @@ static bool do_cmd_open_aux(POSITION y, POSITION x) else if (f_ptr->power) { /* Disarm factor */ - i = p_ptr->skill_dis; + i = creature_ptr->skill_dis; /* Penalize some conditions */ - if (p_ptr->blind || no_lite()) i = i / 10; - if (p_ptr->confused || p_ptr->image) i = i / 10; + if (creature_ptr->blind || no_lite()) i = i / 10; + if (creature_ptr->confused || creature_ptr->image) i = i / 10; /* Extract the lock power */ j = f_ptr->power; @@ -784,7 +784,7 @@ static bool do_cmd_open_aux(POSITION y, POSITION x) sound(SOUND_OPENDOOR); /* Experience */ - gain_exp(p_ptr, 1); + gain_exp(creature_ptr, 1); } /* Failure */ @@ -894,7 +894,7 @@ void do_cmd_open(player_type *creature_ptr) } else { - more = do_cmd_open_aux(y, x); + more = do_cmd_open_aux(creature_ptr, y, x); } } @@ -1872,7 +1872,7 @@ void do_cmd_alter(void) /* Locked doors */ else if (have_flag(f_ptr->flags, FF_OPEN)) { - more = do_cmd_open_aux(y, x); + more = do_cmd_open_aux(p_ptr, y, x); } /* Bash jammed doors */ -- 2.11.0