OSDN Git Service

* [Refactor] #37353 型の置換(cmd4.c) / Type replacement.
[hengband/hengband.git] / src / grid.c
index c0b0e71..46b10b5 100644 (file)
@@ -96,36 +96,28 @@ void place_random_stairs(POSITION y, POSITION x)
        if (!is_floor_grid(c_ptr) || c_ptr->o_idx) return;
 
        /* Town */
-       if (!dun_level)
-               up_stairs = FALSE;
+       if (!dun_level) up_stairs = FALSE;
 
        /* Ironman */
-       if (ironman_downward)
-               up_stairs = FALSE;
+       if (ironman_downward) up_stairs = FALSE;
 
        /* Bottom */
-       if (dun_level >= d_info[dungeon_type].maxdepth)
-               down_stairs = FALSE;
+       if (dun_level >= d_info[dungeon_type].maxdepth) down_stairs = FALSE;
 
        /* Quest-level */
-       if (quest_number(dun_level) && (dun_level > 1))
-               down_stairs = FALSE;
+       if (quest_number(dun_level) && (dun_level > 1)) down_stairs = FALSE;
 
        /* We can't place both */
        if (down_stairs && up_stairs)
        {
                /* Choose a staircase randomly */
-               if (randint0(100) < 50)
-                       up_stairs = FALSE;
-               else
-                       down_stairs = FALSE;
+               if (randint0(100) < 50) up_stairs = FALSE;
+               else down_stairs = FALSE;
        }
 
        /* Place the stairs */
-       if (up_stairs)
-               place_up_stairs(y, x);
-       else if (down_stairs)
-               place_down_stairs(y, x);
+       if (up_stairs) place_up_stairs(y, x);
+       else if (down_stairs) place_down_stairs(y, x);
 }
 
 /*!
@@ -412,8 +404,6 @@ static int next_to_corr(POSITION y1, POSITION x1)
                /* Extract the location */
                y = y1 + ddy_ddd[i];
                x = x1 + ddx_ddd[i];
-
-               /* Access the grid */
                c_ptr = &cave[y][x];
 
                /* Skip non floors */
@@ -441,7 +431,7 @@ static int next_to_corr(POSITION y1, POSITION x1)
 * @return ドアを設置可能ならばTRUEを返す
 * @note Assumes "in_bounds(y1, x1)"
 * @details
-* XXX XXX XXX\n
+* \n
 * Assumes "in_bounds(y, x)"\n
 */
 static bool possible_doorway(POSITION y, POSITION x)
@@ -582,24 +572,19 @@ void vault_objects(POSITION y, POSITION x, int num)
                                break;
                        }
 
-
                        if (dummy >= SAFE_MAX_ATTEMPTS && cheat_room)
                        {
                                msg_print(_("警告!地下室のアイテムを配置できません!", "Warning! Could not place vault object!"));
                        }
 
-
                        /* Require "clean" floor space */
                        c_ptr = &cave[j][k];
                        if (!is_floor_grid(c_ptr) || c_ptr->o_idx) continue;
 
-                       /* Place an item */
                        if (randint0(100) < 75)
                        {
                                place_object(j, k, 0L);
                        }
-
-                       /* Place gold */
                        else
                        {
                                place_gold(j, k);
@@ -727,7 +712,7 @@ void vault_monsters(POSITION y1, POSITION x1, int num)
  * @param x2 終点X座標
  * @return なし
  */
-void correct_dir(int *rdir, int *cdir, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
+void correct_dir(POSITION *rdir, POSITION *cdir, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
 {
        /* Extract vertical and horizontal directions */
        *rdir = (y1 == y2) ? 0 : (y1 < y2) ? 1 : -1;
@@ -749,7 +734,7 @@ void correct_dir(int *rdir, int *cdir, POSITION y1, POSITION x1, POSITION y2, PO
  * @param cdir X方向に取るべきベクトル値を返す参照ポインタ
  * @return なし
  */
-void rand_dir(int *rdir, int *cdir)
+void rand_dir(POSITION *rdir, POSITION *cdir)
 {
        /* Pick a random direction */
        int i = randint0(4);