OSDN Git Service

[Refactor] #38997 init_other() にplayer_type * 引数を追加 / Added player_type * argument...
authorHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 05:11:46 +0000 (14:11 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 05:11:46 +0000 (14:11 +0900)
src/grid.c
src/init.c

index 48f0673..7a584ef 100644 (file)
@@ -478,6 +478,7 @@ void print_rel(player_type *subject_ptr, SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y
 
 
 /*
+ * todo ここにplayer_type を追加した時のコンパイルエラーに対処できなかったので保留
  * Memorize interesting viewable object/features in the given grid
  *
  * This function should only be called on "legal" grids.
index 27d0c97..dc11933 100644 (file)
@@ -1213,25 +1213,25 @@ static errr init_feat_variables(void)
  * Initialize some other arrays
  * @return エラーコード
  */
-static errr init_other(void)
+static errr init_other(player_type *player_ptr)
 {
        int i, n;
 
-       p_ptr->current_floor_ptr = &floor_info; // TODO:本当はこんなところで初期化したくない
-
+       player_ptr->current_floor_ptr = &floor_info; // TODO:本当はこんなところで初期化したくない
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
 
        /*** Prepare the "dungeon" information ***/
 
        /* Allocate and Wipe the object list */
-       C_MAKE(p_ptr->current_floor_ptr->o_list, current_world_ptr->max_o_idx, object_type);
+       C_MAKE(floor_ptr->o_list, current_world_ptr->max_o_idx, object_type);
 
        /* Allocate and Wipe the monster list */
-       C_MAKE(p_ptr->current_floor_ptr->m_list, current_world_ptr->max_m_idx, monster_type);
+       C_MAKE(floor_ptr->m_list, current_world_ptr->max_m_idx, monster_type);
 
        /* Allocate and Wipe the monster process list */
        for (i = 0; i < MAX_MTIMED; i++)
        {
-               C_MAKE(p_ptr->current_floor_ptr->mproc_list[i], current_world_ptr->max_m_idx, s16b);
+               C_MAKE(floor_ptr->mproc_list[i], current_world_ptr->max_m_idx, s16b);
        }
 
        /* Allocate and Wipe the max dungeon level */
@@ -1239,10 +1239,9 @@ static errr init_other(void)
 
        for (i = 0; i < MAX_HGT; i++)
        {
-               C_MAKE(p_ptr->current_floor_ptr->grid_array[i], MAX_WID, grid_type);
+               C_MAKE(floor_ptr->grid_array[i], MAX_WID, grid_type);
        }
 
-
        /*** Prepare the various "bizarre" arrays ***/
 
        /* Macro variables */
@@ -1854,12 +1853,10 @@ void init_angband(player_type *player_ptr)
 
        if (init_wilderness()) quit(_("荒野を初期化できません", "Cannot initialize wilderness"));
 
-
        /* Initialize town array */
        note(_("[配列を初期化しています... (街)]", "[Initializing arrays... (towns)]"));
        if (init_towns()) quit(_("街を初期化できません", "Cannot initialize towns"));
 
-
        /* Initialize building array */
        note(_("[配列を初期化しています... (建物)]", "[Initializing arrays... (buildings)]"));
        if (init_buildings()) quit(_("建物を初期化できません", "Cannot initialize buildings"));
@@ -1874,15 +1871,12 @@ void init_angband(player_type *player_ptr)
 
        /* Initialize some other arrays */
        note(_("[データの初期化中... (その他)]", "[Initializing arrays... (other)]"));
-       if (init_other()) quit(_("その他のデータ初期化不能", "Cannot initialize other stuff"));
-
+       if (init_other(player_ptr)) quit(_("その他のデータ初期化不能", "Cannot initialize other stuff"));
 
        /* Initialize some other arrays */
        note(_("[データの初期化中... (アロケーション)]", "[Initializing arrays... (alloc)]"));
        if (init_alloc()) quit(_("アロケーション・スタッフ初期化不能", "Cannot initialize alloc stuff"));
 
-
-
        /*** Load default user pref files ***/
 
        /* Initialize feature info */
@@ -1903,6 +1897,7 @@ void init_angband(player_type *player_ptr)
        note(_("[初期化終了]", "[Initialization complete]"));
 }
 
+
 /*!
  * @brief タイトル記述
  * @return なし
@@ -1922,6 +1917,7 @@ static void put_title(void)
        prt(title, VER_INFO_ROW, col);
 }
 
+
 /*!
  * @brief サムチェック情報を出力 / Get check sum in string form
  * @return サムチェック情報の文字列