From ca66db83db689b2a8e474842e316eef004488866 Mon Sep 17 00:00:00 2001 From: deskull Date: Thu, 18 Jul 2019 00:43:44 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20easy=5Fopen=5Fdoor()=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 | 10 +++++----- src/cmd-basic.h | 2 +- src/player-move.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cmd-basic.c b/src/cmd-basic.c index 17f548279..cdbed3bbd 100644 --- a/src/cmd-basic.c +++ b/src/cmd-basic.c @@ -1293,7 +1293,7 @@ void do_cmd_tunnel(player_type *creature_ptr) * do_cmd_open_test() and exe_open(). * */ -bool easy_open_door(POSITION y, POSITION x) +bool easy_open_door(player_type *creature_ptr, POSITION y, POSITION x) { int i, j; @@ -1318,11 +1318,11 @@ bool easy_open_door(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; @@ -1344,7 +1344,7 @@ bool easy_open_door(POSITION y, POSITION x) sound(SOUND_OPENDOOR); /* Experience */ - gain_exp(p_ptr, 1); + gain_exp(creature_ptr, 1); } /* Failure */ diff --git a/src/cmd-basic.h b/src/cmd-basic.h index 9220cd33a..5357cb59e 100644 --- a/src/cmd-basic.h +++ b/src/cmd-basic.h @@ -26,7 +26,7 @@ extern void do_cmd_rest(void); extern void do_cmd_fire(SPELL_IDX snipe_type); extern void exe_fire(INVENTORY_IDX item, object_type *j_ptr, SPELL_IDX snipe_type); extern bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken); -extern bool easy_open_door(POSITION y, POSITION x); +extern bool easy_open_door(player_type *creature_ptr, POSITION y, POSITION x); extern bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir); extern void kamaenaoshi(INVENTORY_IDX item); diff --git a/src/player-move.c b/src/player-move.c index 6843897c8..a4fc27294 100644 --- a/src/player-move.c +++ b/src/player-move.c @@ -1197,7 +1197,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap) else { /* Closed doors */ - if (easy_open && is_closed_door(feat) && easy_open_door(y, x)) return; + if (easy_open && is_closed_door(feat) && easy_open_door(p_ptr, y, x)) return; #ifdef JP msg_format("%sが行く手をはばんでいる。", name); -- 2.11.0