OSDN Git Service

Target quest infomations are not initialized when getting quest name from q_info...
authoriks <iks@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 25 Jan 2013 12:09:08 +0000 (12:09 +0000)
committeriks <iks@0568b783-4c39-0410-ac80-bf13821ea2a2>
Fri, 25 Jan 2013 12:09:08 +0000 (12:09 +0000)
src/bldg.c
src/cmd4.c
src/defines.h
src/files.c
src/generate.c
src/init1.c
src/xtra2.c

index 274a86c..c9262aa 100644 (file)
@@ -2937,7 +2937,7 @@ msg_print("
 /*
  * Display quest information
  */
-static void get_questinfo(int questnum)
+static void get_questinfo(int questnum, bool do_init)
 {
        int     i;
        int     old_quest;
@@ -2957,7 +2957,8 @@ static void get_questinfo(int questnum)
        p_ptr->inside_quest = questnum;
 
        /* Get the quest text */
-       init_flags = INIT_SHOW_TEXT | INIT_ASSIGN;
+       init_flags = INIT_SHOW_TEXT;
+       if (do_init) init_flags |= INIT_ASSIGN;
 
        process_dungeon_file("q_info.txt", 0, 0, 0, 0);
 
@@ -3018,14 +3019,14 @@ put_str("
                /* Rewarded quest */
                q_ptr->status = QUEST_STATUS_REWARDED;
 
-               get_questinfo(q_index);
+               get_questinfo(q_index, FALSE);
 
                reinit_wilderness = TRUE;
        }
        /* Failed quest */
        else if (q_ptr->status == QUEST_STATUS_FAILED)
        {
-               get_questinfo(q_index);
+               get_questinfo(q_index, FALSE);
 
                /* Mark quest as done (but failed) */
                q_ptr->status = QUEST_STATUS_FAILED_DONE;
@@ -3098,7 +3099,7 @@ msg_format("
                }
                else
                {
-                       get_questinfo(q_index);
+                       get_questinfo(q_index, TRUE);
                }
        }
 }
index 3cc5921..8e11092 100644 (file)
@@ -386,7 +386,7 @@ errr do_cmd_write_nikki(int type, int num, cptr note)
                p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
 
                /* Get the quest text */
-               init_flags = INIT_ASSIGN;
+               init_flags = INIT_NAME_ONLY;
 
                process_dungeon_file("q_info.txt", 0, 0, 0, 0);
 
@@ -9424,7 +9424,7 @@ void do_cmd_knowledge_quests_completed(FILE *fff, int quest_num[])
                                p_ptr->inside_quest = q_idx;
 
                                /* Get the quest */
-                               init_flags = INIT_ASSIGN;
+                               init_flags = INIT_NAME_ONLY;
 
                                process_dungeon_file("q_info.txt", 0, 0, 0, 0);
 
@@ -9516,7 +9516,7 @@ void do_cmd_knowledge_quests_failed(FILE *fff, int quest_num[])
                                p_ptr->inside_quest = q_idx;
 
                                /* Get the quest text */
-                               init_flags = INIT_ASSIGN;
+                               init_flags = INIT_NAME_ONLY;
 
                                process_dungeon_file("q_info.txt", 0, 0, 0, 0);
 
index 9534b33..27295ab 100644 (file)
@@ -4630,11 +4630,12 @@ extern int PlayerUID;
 /*
  * Initialization flags
  */
-#define INIT_SHOW_TEXT          0x01
-#define INIT_ASSIGN             0x02
-#define INIT_CREATE_DUNGEON     0x04
-#define INIT_ONLY_FEATURES      0x08
-#define INIT_ONLY_BUILDINGS     0x10
+#define INIT_NAME_ONLY          0x01
+#define INIT_SHOW_TEXT          0x02
+#define INIT_ASSIGN             0x04
+#define INIT_CREATE_DUNGEON     0x08
+#define INIT_ONLY_FEATURES      0x10
+#define INIT_ONLY_BUILDINGS     0x20
 
 /*
  * Quest flags
index 8fa8d3f..ee1c47c 100644 (file)
@@ -3887,7 +3887,7 @@ void display_player(int mode)
                                {
                                        /* Get the quest text */
                                        /* Bewere that INIT_ASSIGN resets the cur_num. */
-                                       init_flags = INIT_ASSIGN;
+                                       init_flags = INIT_NAME_ONLY;
 
                                        process_dungeon_file("q_info.txt", 0, 0, 0, 0);
 
@@ -3927,7 +3927,7 @@ void display_player(int mode)
                                        quest_text_line = 0;
 
                                        /* Get the quest text */
-                                       init_flags = INIT_SHOW_TEXT;
+                                       init_flags = INIT_NAME_ONLY;
 
                                        process_dungeon_file("q_info.txt", 0, 0, 0, 0);
 
index a5a542f..78feddb 100644 (file)
@@ -1340,7 +1340,7 @@ static void quest_gen(void)
        /* Prepare allocation table */
        get_mon_num_prep(get_monster_hook(), NULL);
 
-       init_flags = INIT_CREATE_DUNGEON | INIT_ASSIGN;
+       init_flags = INIT_CREATE_DUNGEON;
 
        process_dungeon_file("q_info.txt", 0, 0, MAX_HGT, MAX_WID);
 }
index 74b47af..73970e1 100644 (file)
@@ -3906,7 +3906,7 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in
                /* Process "Q:<q_index>:N:<name>" -- quest name */
                else if (zz[1][0] == 'N')
                {
-                       if (init_flags & (INIT_ASSIGN | INIT_SHOW_TEXT))
+                       if (init_flags & (INIT_ASSIGN | INIT_SHOW_TEXT | INIT_NAME_ONLY))
                        {
                                strcpy(q_ptr->name, zz[2]);
                        }
index 6e9e95c..0bbc829 100644 (file)
@@ -3639,7 +3639,7 @@ static int target_set_aux(int y, int x, int mode, cptr info)
                        p_ptr->inside_quest = c_ptr->special;
 
                        /* Get the quest text */
-                       init_flags = INIT_SHOW_TEXT;
+                       init_flags = INIT_NAME_ONLY;
 
                        process_dungeon_file("q_info.txt", 0, 0, 0, 0);