OSDN Git Service

[Refactor] #define ALLOW_EASY_DISARM による分岐処理削除 / Delete #define branch by ALLOW_EASY_...
authorDeskull <deskull@users.sourceforge.jp>
Sat, 24 Nov 2018 06:00:54 +0000 (15:00 +0900)
committerDeskull <deskull@users.sourceforge.jp>
Sat, 24 Nov 2018 06:00:54 +0000 (15:00 +0900)
src/cmd1.c
src/cmd2.c
src/dungeon.c
src/externs.h

index 3d4262a..0cbf8b6 100644 (file)
@@ -1388,7 +1388,6 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->levitation && (!p_ptr->riding || !(riding_r_ptr->flags8 & RF8_WILD_WOOD))) p_ptr->energy_use *= 2;
        }
 
-#ifdef ALLOW_EASY_DISARM /* TNB */
 
        /* Disarm a visible trap */
        else if ((do_pickup != easy_disarm) && have_flag(f_ptr->flags, FF_DISARM) && !c_ptr->mimic)
@@ -1400,7 +1399,6 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
                }
        }
 
-#endif /* ALLOW_EASY_DISARM -- TNB */
 
        /* Player can not walk through "walls" unless in wraith form...*/
        else if (!p_can_enter && !p_can_kill_walls)
@@ -1529,16 +1527,7 @@ void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
 
                /* sound(SOUND_WALK); */
 
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
                if (do_pickup != always_pickup) mpe_mode |= MPE_DO_PICKUP;
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-               if (do_pickup) mpe_mode |= MPE_DO_PICKUP;
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
                if (break_trap) mpe_mode |= MPE_BREAK_TRAP;
 
                /* Move the player */
@@ -2147,16 +2136,8 @@ void run_step(DIRECTION dir)
        p_ptr->energy_use = 100;
 
        /* Move the player, using the "pickup" flag */
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
        move_player(find_current, FALSE, FALSE);
 
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-       move_player(find_current, always_pickup, FALSE);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
        if (player_bold(p_ptr->run_py, p_ptr->run_px))
        {
                p_ptr->run_py = 0;
index aa12d07..794cd2a 100644 (file)
@@ -1432,15 +1432,8 @@ static bool do_cmd_disarm_chest(POSITION y, POSITION x, OBJECT_IDX o_idx)
  * Returns TRUE if repeated commands may continue
  * </pre>
  */
-#ifdef ALLOW_EASY_DISARM /* TNB */
 
 bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-static bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
 {
        /* Get grid and contents */
        cave_type *c_ptr = &cave[y][x];
@@ -1482,17 +1475,8 @@ static bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
                /* Remove the trap */
                cave_alter_feat(y, x, FF_DISARM);
 
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
                /* Move the player onto the trap */
                move_player(dir, easy_disarm, FALSE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-               /* move the player onto the trap grid */
-               move_player(dir, FALSE, FALSE);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
        }
 
        /* Failure -- Keep trying */
@@ -1511,18 +1495,8 @@ static bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
        else
        {
                msg_format(_("%sを作動させてしまった!", "You set off the %s!"), name);
-
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
                /* Move the player onto the trap */
                move_player(dir, easy_disarm, FALSE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-               /* Move the player onto the trap */
-               move_player(dir, FALSE, FALSE);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
        }
 
        /* Result */
@@ -1548,7 +1522,6 @@ void do_cmd_disarm(void)
                set_action(ACTION_NONE);
        }
 
-#ifdef ALLOW_EASY_DISARM /* TNB */
 
        /* Option: Pick a direction */
        if (easy_disarm)
@@ -1569,7 +1542,6 @@ void do_cmd_disarm(void)
                }
        }
 
-#endif /* ALLOW_EASY_DISARM -- TNB */
 
        /* Allow repeated command */
        if (command_arg)
index 53e851a..d8d7797 100644 (file)
@@ -3885,32 +3885,14 @@ static void process_command(void)
                /* Move (usually pick up things) */
                case ';':
                {
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
                        do_cmd_walk(FALSE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-                       do_cmd_walk(always_pickup);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
                        break;
                }
 
                /* Move (usually do not pick up) */
                case '-':
                {
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
                        do_cmd_walk(TRUE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-                       do_cmd_walk(!always_pickup);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
                        break;
                }
 
index 348df36..7d97cb2 100644 (file)
@@ -1455,7 +1455,6 @@ extern bool easy_open;
 /* cmd2.c */
 extern bool easy_open_door(POSITION y, POSITION x);
 
-#ifdef ALLOW_EASY_DISARM /* TNB */
 
 /* variable.c */
 extern bool easy_disarm;
@@ -1463,8 +1462,6 @@ extern bool easy_disarm;
 /* cmd2.c */
 extern bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir);
 
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
 
 #ifdef ALLOW_EASY_FLOOR /* TNB */