OSDN Git Service

[Refactor] #38997 parse_line_wilderness() にplayer_type * 引数を追加 / Added floor_type...
authorHourier <hourier@users.sourceforge.jp>
Sat, 11 Jan 2020 12:47:54 +0000 (21:47 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 11 Jan 2020 12:47:54 +0000 (21:47 +0900)
src/dungeon-file.c
src/wild.c
src/wild.h

index c8a7fd2..250a62b 100644 (file)
@@ -4114,7 +4114,7 @@ static errr process_dungeon_file_aux(player_type *player_ptr, char *buf, int ymi
        /* Process "W:<command>: ..." -- info for the wilderness */
        else if (buf[0] == 'W')
        {
-               return parse_line_wilderness(buf, ymin, xmin, ymax, xmax, y, x);
+               return parse_line_wilderness(player_ptr, buf, ymin, xmin, ymax, xmax, y, x);
        }
 
        /* Process "P:<y>:<x>" -- player position */
index c97e0cb..1272020 100644 (file)
@@ -33,6 +33,8 @@
 
 #include "view-mainwindow.h"
 
+#define MAX_FEAT_IN_TERRAIN 18
+
  /*
   * Wilderness
   */
@@ -40,7 +42,6 @@ wilderness_type **wilderness;
 
 bool generate_encounter;
 
-
 /*!
  * @brief 地形生成確率を決める要素100の配列を確率テーブルから作成する
  * @param feat_type 非一様確率を再現するための要素数100の配列
@@ -62,6 +63,7 @@ static void set_floor_and_wall_aux(s16b feat_type[100], feat_prob prob[DUNGEON_F
        }
 }
 
+
 /*!
  * @brief ダンジョンの地形を指定確率に応じて各マスへランダムに敷き詰める
  * / Fill the arrays of floors and walls in the good proportions
@@ -212,8 +214,6 @@ static void plasma_recursive(floor_type *floor_ptr, POSITION x1, POSITION y1, PO
 }
 
 
-#define MAX_FEAT_IN_TERRAIN 18
-
 /*
  * The default table in terrain level generation.
  */
@@ -320,7 +320,6 @@ static void generate_wilderness_area(floor_type *floor_ptr, int terrain, u32b se
 }
 
 
-
 /*!
  * @brief 荒野フロア生成のメインルーチン /
  * Load a town or generate a terrain level using "plasma" fractals.
@@ -465,7 +464,6 @@ static void generate_area(player_type *player_ptr, POSITION y, POSITION x, bool
  */
 static border_type border;
 
-
 /*!
  * @brief 広域マップの生成 /
  * Build the wilderness area outside of the town.
@@ -776,7 +774,6 @@ struct wilderness_grid
 
 static wilderness_grid w_letter[255];
 
-
 /*!
  * @brief w_info.txtのデータ解析 /
  * Parse a sub-file of the "extra info"
@@ -789,7 +786,7 @@ static wilderness_grid w_letter[255];
  * @param x 広域マップの幅を返す参照ポインタ
  * @return なし
  */
-errr parse_line_wilderness(char *buf, int ymin, int xmin, int ymax, int xmax, int *y, int *x)
+errr parse_line_wilderness(player_type *creature_ptr, char *buf, int ymin, int xmin, int ymax, int xmax, int *y, int *x)
 {
        int i, num;
        char *zz[33];
@@ -880,18 +877,18 @@ errr parse_line_wilderness(char *buf, int ymin, int xmin, int ymax, int xmax, in
        /* Process "W:P:<x>:<y> - starting position in the wilderness */
        case 'P':
        {
-               if ((p_ptr->wilderness_x == 0) &&
-                   (p_ptr->wilderness_y == 0))
+               if ((creature_ptr->wilderness_x == 0) &&
+                   (creature_ptr->wilderness_y == 0))
                {
                        if (tokenize(buf+4, 2, zz, 0) == 2)
                        {
-                               p_ptr->wilderness_y = atoi(zz[0]);
-                               p_ptr->wilderness_x = atoi(zz[1]);
+                               creature_ptr->wilderness_y = atoi(zz[0]);
+                               creature_ptr->wilderness_x = atoi(zz[1]);
                                
-                               if ((p_ptr->wilderness_x < 1) ||
-                                   (p_ptr->wilderness_x > current_world_ptr->max_wild_x) ||
-                                   (p_ptr->wilderness_y < 1) ||
-                                   (p_ptr->wilderness_y > current_world_ptr->max_wild_y))
+                               if ((creature_ptr->wilderness_x < 1) ||
+                                   (creature_ptr->wilderness_x > current_world_ptr->max_wild_x) ||
+                                   (creature_ptr->wilderness_y < 1) ||
+                                   (creature_ptr->wilderness_y > current_world_ptr->max_wild_y))
                                {
                                        return (PARSE_ERROR_OUT_OF_BOUNDS);
                                }
@@ -923,7 +920,6 @@ errr parse_line_wilderness(char *buf, int ymin, int xmin, int ymax, int xmax, in
 }
 
 
-
 /*!
  * @brief ゲーム開始時に各荒野フロアの乱数シードを指定する /
  * Generate the random seeds for the wilderness
@@ -950,7 +946,6 @@ void seed_wilderness(void)
  */
 typedef wilderness_type *wilderness_type_ptr;
 
-
 /*!
  * @brief ゲーム開始時の荒野初期化メインルーチン /
  * Initialize wilderness array
@@ -973,6 +968,7 @@ errr init_wilderness(void)
        return 0;
 }
 
+
 /*!
  * @brief 荒野の地勢設定を初期化する /
  * Initialize wilderness array
@@ -1108,6 +1104,7 @@ void init_wilderness_terrains(void)
                feat_mountain, MAX_FEAT_IN_TERRAIN - 8);
 }
 
+
 /*!
  * @brief 荒野から広域マップへの切り替え処理 /
  * Initialize arrays for wilderness terrains
index 37da8d4..f1b9d5e 100644 (file)
@@ -31,7 +31,7 @@ extern void wilderness_gen_small(player_type *creature_ptr);
 extern errr init_wilderness(void);
 extern void init_wilderness_terrains(void);
 extern void seed_wilderness(void);
-extern errr parse_line_wilderness(char *buf, int ymin, int xmin, int ymax, int xmax, int *y, int *x);
+extern errr parse_line_wilderness(player_type *creature_ptr, char *buf, int ymin, int xmin, int ymax, int xmax, int *y, int *x);
 extern bool change_wild_mode(player_type *creature_ptr, bool encount);
 
 /* Border */