OSDN Git Service

[Refactor] #37353 マジックナンバー修正(A_MAX) / Fix magic number (A_MAX).
[hengband/hengband.git] / src / init2.c
index 0a330c5..7669de9 100644 (file)
@@ -35,6 +35,7 @@
 #include "angband.h"
 
 #include "init.h"
+#include "trap.h"
 
 #ifndef MACINTOSH
 #ifdef CHECK_MODIFICATION_TIME
@@ -525,7 +526,6 @@ static errr init_info(cptr filename, header *head,
                        /* Error string */
                        oops = (((err > 0) && (err < PARSE_ERROR_MAX)) ? err_str[err] : "未知の");
 
-                       /* Oops */
                        msg_format("'%s.txt'ファイルの %d 行目にエラー。", filename, error_line);
                        msg_format("レコード %d は '%s' エラーがあります。", error_idx, oops);
                        msg_format("構文 '%s'。", buf);
@@ -537,7 +537,6 @@ static errr init_info(cptr filename, header *head,
                        /* Error string */
                        oops = (((err > 0) && (err < PARSE_ERROR_MAX)) ? err_str[err] : "unknown");
 
-                       /* Oops */
                        msg_format("Error %d at line %d of '%s.txt'.", err, error_line, filename);
                        msg_format("Record %d contains a '%s' error.", error_idx, oops);
                        msg_format("Parsing '%s'.", buf);
@@ -1600,7 +1599,7 @@ static bool feat_tag_is_not_found = FALSE;
  */
 s16b f_tag_to_index_in_init(cptr str)
 {
-       s16b feat = f_tag_to_index(str);
+       FEAT_IDX feat = f_tag_to_index(str);
 
        if (feat < 0) feat_tag_is_not_found = TRUE;
 
@@ -1738,6 +1737,14 @@ static errr init_feat_variables(void)
        feat_shallow_water = f_tag_to_index_in_init("SHALLOW_WATER");
        feat_deep_lava = f_tag_to_index_in_init("DEEP_LAVA");
        feat_shallow_lava = f_tag_to_index_in_init("SHALLOW_LAVA");
+       feat_heavy_cold_zone = f_tag_to_index_in_init("HEAVY_COLD_ZONE");
+       feat_cold_zone = f_tag_to_index_in_init("COLD_ZONE");
+       feat_heavy_electrical_zone = f_tag_to_index_in_init("HEAVY_ELECTRICAL_ZONE");
+       feat_electrical_zone = f_tag_to_index_in_init("ELECTRICAL_ZONE");
+       feat_deep_acid_puddle = f_tag_to_index_in_init("DEEP_ACID_PUDDLE");
+       feat_shallow_acid_puddle = f_tag_to_index_in_init("SHALLOW_ACID_PUDDLE");
+       feat_deep_poisonous_puddle = f_tag_to_index_in_init("DEEP_POISONOUS_PUDDLE");
+       feat_shallow_poisonous_puddle = f_tag_to_index_in_init("SHALLOW_POISONOUS_PUDDLE");
        feat_dirt = f_tag_to_index_in_init("DIRT");
        feat_grass = f_tag_to_index_in_init("GRASS");
        feat_flower = f_tag_to_index_in_init("FLOWER");
@@ -1868,7 +1875,7 @@ static errr init_other(void)
         *  Window 1 : Display messages
         *  Window 2 : Display inven/equip
         */
-       window_flag[1] = 1L << 6;
+       window_flag[1] = 1L << A_MAX;
        window_flag[2] = 1L << 0;
 
 
@@ -2177,7 +2184,7 @@ static void note(cptr str)
  * @return なし
  * @note
  * <pre>
- * XXX XXX XXX This function is "messy" because various things
+ * This function is "messy" because various things
  * may or may not be initialized, but the "plog()" and "quit()"
  * functions are "supposed" to work under any conditions.
  * </pre>
@@ -2222,7 +2229,7 @@ static void init_angband_aux(cptr why)
  * @return なし
  * @note
  * <pre>
- * XXX XXX XXX This function is "messy" because various things
+ * This function is "messy" because various things
  * may or may not be initialized, but the "plog()" and "quit()"
  * functions are "supposed" to work under any conditions.
  * Verify some files, display the "news.txt" file, create
@@ -2286,7 +2293,6 @@ void init_angband(void)
        {
                char why[1024];
 
-               /* Message */
                sprintf(why, _("'%s'ファイルにアクセスできません!", "Cannot access the '%s' file!"), buf);
 
                /* Crash and burn */
@@ -2298,8 +2304,6 @@ void init_angband(void)
 
 
        /*** Display the "news" file ***/
-
-       /* Clear screen */
        Term_clear();
 
        /* Build the filename */
@@ -2356,7 +2360,6 @@ void init_angband(void)
                {
                        char why[1024];
 
-                       /* Message */
                        sprintf(why, _("'%s'ファイルを作成できません!", "Cannot create the '%s' file!"), buf);
 
                        /* Crash and burn */
@@ -2476,7 +2479,6 @@ void init_angband(void)
        /* Process that file */
        process_pref_file(buf);
 
-       /* Done */
        note(_("[初期化終了]", "[Initialization complete]"));
 }