OSDN Git Service

Vanillaにならって、キャラクターの状態を表わすグローバル変数の多くを
[hengband/hengband.git] / src / wild.c
index 30094c1..8521d77 100644 (file)
@@ -428,7 +428,7 @@ static int terrain_table[MAX_WILDERNESS][18] =
 };
 
 
-void generate_wilderness_area(int terrain, u32b seed, bool border, bool corner)
+static void generate_wilderness_area(int terrain, u32b seed, bool border, bool corner)
 {
        int x1, y1;
        int table_size = sizeof(terrain_table[0]) / sizeof(int);
@@ -605,7 +605,7 @@ static void generate_area(int y, int x, bool border, bool corner)
                }
        }
 
-       if (wilderness[y][x].entrance && !wilderness[y][x].town && (total_winner || !(d_info[wilderness[y][x].entrance].flags1 & DF1_WINNER)))
+       if (wilderness[y][x].entrance && !wilderness[y][x].town && (p_ptr->total_winner || !(d_info[wilderness[y][x].entrance].flags1 & DF1_WINNER)))
        {
                int dy, dx;
 
@@ -639,7 +639,6 @@ static border_type border;
 void wilderness_gen(void)
 {
        int i, y, x, lim;
-       bool daytime;
        cave_type *c_ptr;
 
        /* Big town */
@@ -647,8 +646,8 @@ void wilderness_gen(void)
        cur_wid = MAX_WID;
 
        /* Assume illegal panel */
-       panel_row_min = 255;
-       panel_col_min = 255;
+       panel_row_min = cur_hgt;
+       panel_col_min = cur_wid;
 
        /* Init the wilderness */
 
@@ -753,13 +752,6 @@ void wilderness_gen(void)
        /* South east corner */
        cave[MAX_HGT - 1][MAX_WID - 1].mimic = border.south_east;
 
-
-       /* Day time */
-       if ((turn % (20L * TOWN_DAWN)) < ((20L * TOWN_DAWN) / 2))
-               daytime = TRUE;
-       else
-               daytime = FALSE;
-
        /* Light up or darken the area */
        for (y = 0; y < cur_hgt; y++)
        {
@@ -768,7 +760,7 @@ void wilderness_gen(void)
                        /* Get the cave grid */
                        c_ptr = &cave[y][x];
 
-                       if (daytime)
+                       if (is_daytime())
                        {
                                /* Assume lit */
                                c_ptr->info |= (CAVE_GLOW);
@@ -781,7 +773,7 @@ void wilderness_gen(void)
                                /* Darken "boring" features */
                                if ((c_ptr->feat <= FEAT_INVIS) ||
                                    ((c_ptr->feat >= FEAT_DEEP_WATER) &&
-                                       (c_ptr->feat <= FEAT_TREES) &&
+                                       (c_ptr->feat <= FEAT_MOUNTAIN) &&
                                     (c_ptr->feat != FEAT_MUSEUM)) ||
                                    (x == 0) || (x == cur_wid-1) ||
                                    (y == 0) || (y == cur_hgt-1))
@@ -894,7 +886,7 @@ void wilderness_gen_small()
                        cave[j][i].special = wilderness[j][i].town;
                }
                else if (wilderness[j][i].road) cave[j][i].feat = FEAT_FLOOR;
-               else if (wilderness[j][i].entrance && (total_winner || !(d_info[wilderness[j][i].entrance].flags1 & DF1_WINNER)))
+               else if (wilderness[j][i].entrance && (p_ptr->total_winner || !(d_info[wilderness[j][i].entrance].flags1 & DF1_WINNER)))
                {
                        cave[j][i].feat = FEAT_ENTRANCE;
                        cave[j][i].special = (byte)wilderness[j][i].entrance;
@@ -911,8 +903,8 @@ void wilderness_gen_small()
        if (cur_wid > MAX_WID) cur_wid = MAX_WID;
 
        /* Assume illegal panel */
-       panel_row_min = 255;
-       panel_col_min = 255;
+       panel_row_min = cur_hgt;
+       panel_col_min = cur_wid;
 
         /* Place the player */
         px = p_ptr->wilderness_x;
@@ -1160,9 +1152,9 @@ bool change_wild_mode(void)
                if (have_pet)
                {
 #ifdef JP
-                       if(!get_check_strict("¥Ú¥Ã¥È¤òÃÖ¤¤¤Æ¹­°è¥Þ¥Ã¥×¤ËÆþ¤ê¤Þ¤¹¤«¡©", 1))
+                       if(!get_check_strict("¥Ú¥Ã¥È¤òÃÖ¤¤¤Æ¹­°è¥Þ¥Ã¥×¤ËÆþ¤ê¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
 #else
-                       if(!get_check_strict("Do you leave your pets behind? ", 1))
+                       if(!get_check_strict("Do you leave your pets behind? ", CHECK_OKAY_CANCEL))
 #endif
                        {
                                energy_use = 0;