OSDN Git Service

[Refactor] #38997 easy_open_door() に player_type * 引数を追加.
authordeskull <deskull@users.sourceforge.jp>
Wed, 17 Jul 2019 15:43:44 +0000 (00:43 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 17 Jul 2019 15:43:44 +0000 (00:43 +0900)
src/cmd-basic.c
src/cmd-basic.h
src/player-move.c

index 17f5482..cdbed3b 100644 (file)
@@ -1293,7 +1293,7 @@ void do_cmd_tunnel(player_type *creature_ptr)
  *     do_cmd_open_test() and exe_open().
  * </pre>
  */
-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 */
index 9220cd3..5357cb5 100644 (file)
@@ -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);
index 6843897..a4fc272 100644 (file)
@@ -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);