OSDN Git Service

オプションbitのロード時から実際のゲーム開始までの間, 対応するbool変数
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 30 May 2003 07:08:28 +0000 (07:08 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 30 May 2003 07:08:28 +0000 (07:08 +0000)
の値が代入されずFALSEのままである状態だったため, その後の各種情報の
ロードにオプションの状態が反映されないバグを修正.

src/dungeon.c
src/externs.h
src/load.c

index c9e721a..5ef96f1 100644 (file)
@@ -6515,6 +6515,39 @@ static void load_all_pref_files(void)
 
 
 /*
+ * Extract option variables from bit sets
+ */
+void extract_option_vars(void)
+{
+       int i;
+
+       for (i = 0; option_info[i].o_desc; i++)
+       {
+               int os = option_info[i].o_set;
+               int ob = option_info[i].o_bit;
+
+               /* Set the "default" options */
+               if (option_info[i].o_var)
+               {
+                       /* Set */
+                       if (option_flag[os] & (1L << ob))
+                       {
+                               /* Set */
+                               (*option_info[i].o_var) = TRUE;
+                       }
+
+                       /* Clear */
+                       else
+                       {
+                               /* Clear */
+                               (*option_info[i].o_var) = FALSE;
+                       }
+               }
+       }
+}
+
+
+/*
  * Actually play a game
  *
  * If the "new_game" parameter is true, then, after loading the
@@ -6544,7 +6577,7 @@ void play_game(bool new_game)
 
        /* Initialise the resize hooks */
        angband_term[0]->resize_hook = resize_map;
-       
+
        for (i = 1; i < 8; i++)
        {
                /* Does the term exist? */
@@ -6572,29 +6605,7 @@ quit("
        }
 
        /* Extract the options */
-       for (i = 0; option_info[i].o_desc; i++)
-       {
-               int os = option_info[i].o_set;
-               int ob = option_info[i].o_bit;
-
-               /* Set the "default" options */
-               if (option_info[i].o_var)
-               {
-                       /* Set */
-                       if (option_flag[os] & (1L << ob))
-                       {
-                               /* Set */
-                               (*option_info[i].o_var) = TRUE;
-                       }
-
-                       /* Clear */
-                       else
-                       {
-                               /* Clear */
-                               (*option_info[i].o_var) = FALSE;
-                       }
-               }
-       }
+       extract_option_vars();
 
        /* Report waited score */
        if (p_ptr->wait_report_score)
index 942374e..5c0de3f 100644 (file)
@@ -703,6 +703,7 @@ extern void do_cmd_magic_eater(bool only_browse);
 
 /* dungeon.c */
 extern void leave_quest_check(void);
+extern void extract_option_vars(void);
 extern void play_game(bool new_game);
 extern bool psychometry(void);
 extern void leave_level(int level);
index 95e2f73..14ba208 100644 (file)
@@ -1220,6 +1220,9 @@ static void rd_options(void)
                }
        }
 
+       /* Extract the options */
+       extract_option_vars();
+
        if (z_older_than(10, 4, 5))
        {
                if (option_flag[5] & (0x00000001 << 4)) option_flag[5] &= ~(0x00000001 << 4);