OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / cmd2.c
index 4101bfd..d906d5b 100644 (file)
@@ -378,8 +378,6 @@ void do_cmd_search(void)
        {
                /* Set repeat count */
                command_rep = command_arg - 1;
-
-               /* Redraw the state */
                p_ptr->redraw |= (PR_STATE);
 
                /* Cancel the arg */
@@ -740,6 +738,8 @@ void do_cmd_open(void)
 
        bool more = FALSE;
 
+       if (p_ptr->wild_mode) return;
+
        if (p_ptr->special_defense & KATA_MUSOU)
        {
                set_action(ACTION_NONE);
@@ -770,8 +770,6 @@ void do_cmd_open(void)
        {
                /* Set repeat count */
                command_rep = command_arg - 1;
-
-               /* Redraw the state */
                p_ptr->redraw |= (PR_STATE);
 
                /* Cancel the arg */
@@ -898,6 +896,8 @@ void do_cmd_close(void)
 
        bool more = FALSE;
 
+       if (p_ptr->wild_mode) return;
+
        if (p_ptr->special_defense & KATA_MUSOU)
        {
                set_action(ACTION_NONE);
@@ -918,8 +918,6 @@ void do_cmd_close(void)
        {
                /* Set repeat count */
                command_rep = command_arg - 1;
-
-               /* Redraw the state */
                p_ptr->redraw |= (PR_STATE);
 
                /* Cancel the arg */
@@ -1159,8 +1157,6 @@ void do_cmd_tunnel(void)
        {
                /* Set repeat count */
                command_rep = command_arg - 1;
-
-               /* Redraw the state */
                p_ptr->redraw |= (PR_STATE);
 
                /* Cancel the arg */
@@ -1479,16 +1475,17 @@ void do_cmd_disarm(void)
 {
        POSITION y, x;
        DIRECTION dir;
-       s16b o_idx;
+       OBJECT_IDX o_idx;
 
        bool more = FALSE;
 
+       if (p_ptr->wild_mode) return;
+
        if (p_ptr->special_defense & KATA_MUSOU)
        {
                set_action(ACTION_NONE);
        }
 
-
        /* Option: Pick a direction */
        if (easy_disarm)
        {
@@ -1514,8 +1511,6 @@ void do_cmd_disarm(void)
        {
                /* Set repeat count */
                command_rep = command_arg - 1;
-
-               /* Redraw the state */
                p_ptr->redraw |= (PR_STATE);
 
                /* Cancel the arg */
@@ -1556,14 +1551,12 @@ void do_cmd_disarm(void)
                /* Disarm chest */
                else if (o_idx)
                {
-                       /* Disarm the chest */
                        more = do_cmd_disarm_chest(y, x, o_idx);
                }
 
                /* Disarm trap */
                else
                {
-                       /* Disarm the trap */
                        more = do_cmd_disarm_aux(y, x, dir);
                }
        }
@@ -1683,12 +1676,11 @@ static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir)
  */
 void do_cmd_bash(void)
 {
-       int                     y, x, dir;
-
+       int     y, x, dir;
        cave_type       *c_ptr;
-
        bool            more = FALSE;
 
+       if (p_ptr->wild_mode) return;
 
        if (p_ptr->special_defense & KATA_MUSOU)
        {
@@ -1700,8 +1692,6 @@ void do_cmd_bash(void)
        {
                /* Set repeat count */
                command_rep = command_arg - 1;
-
-               /* Redraw the state */
                p_ptr->redraw |= (PR_STATE);
 
                /* Cancel the arg */
@@ -1785,8 +1775,6 @@ void do_cmd_alter(void)
        {
                /* Set repeat count */
                command_rep = command_arg - 1;
-
-               /* Redraw the state */
                p_ptr->redraw |= (PR_STATE);
 
                /* Cancel the arg */
@@ -1908,13 +1896,15 @@ void do_cmd_spike(void)
 {
        DIRECTION dir;
 
+       if (p_ptr->wild_mode) return;
+
        if (p_ptr->special_defense & KATA_MUSOU)
        {
                set_action(ACTION_NONE);
        }
 
        /* Get a "repeated" direction */
-       if (get_rep_dir(&dir,FALSE))
+       if (get_rep_dir(&dir, FALSE))
        {
                POSITION y, x;
                INVENTORY_IDX item;
@@ -1988,8 +1978,6 @@ void do_cmd_walk(bool pickup)
        {
                /* Set repeat count */
                command_rep = command_arg - 1;
-
-               /* Redraw the state */
                p_ptr->redraw |= (PR_STATE);
 
                /* Cancel the arg */
@@ -2095,8 +2083,6 @@ void do_cmd_stay(bool pickup)
        {
                /* Set repeat count */
                command_rep = command_arg - 1;
-
-               /* Redraw the state */
                p_ptr->redraw |= (PR_STATE);
 
                /* Cancel the arg */
@@ -2189,13 +2175,11 @@ void do_cmd_rest(void)
        /* Save the rest code */
        resting = command_arg;
        p_ptr->action = ACTION_REST;
-
-       /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
+       update_creature(p_ptr);
 
-       /* Redraw the state */
        p_ptr->redraw |= (PR_STATE);
-       handle_stuff();
+       update_output();
 
        Term_fresh();
 }
@@ -3155,6 +3139,8 @@ void do_cmd_fire(void)
        object_type *j_ptr, *ammo_ptr;
        cptr q, s;
 
+       if(p_ptr->wild_mode) return;
+
        is_fired = FALSE;       /* not fired yet */
 
        /* Get the "bow" (if any) */
@@ -3267,6 +3253,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
        bool come_back = FALSE;
        bool do_drop = TRUE;
 
+       if (p_ptr->wild_mode) return FALSE;
 
        if (p_ptr->special_defense & KATA_MUSOU)
        {
@@ -3340,7 +3327,6 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
        /* Single object */
        q_ptr->number = 1;
 
-       /* Description */
        object_desc(o_name, q_ptr, OD_OMIT_PREFIX);
 
        if (p_ptr->mighty_throw) mult += 3;