From 121a397b5b8e23b362ddd1aa30e1412feec53198 Mon Sep 17 00:00:00 2001 From: deskull Date: Sun, 8 Dec 2019 21:17:37 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#37353=20inside=5Fquest=20=E3=82=92?= =?utf8?q?=20player=5Ftype=20=E3=81=8B=E3=82=89=20floor=5Ftype=20=E3=81=B8?= =?utf8?q?=E7=A7=BB=E5=8B=95=EF=BC=8E=20/=20Move=20inside=5Fquest=20and=20?= =?utf8?q?player=5Ftype=20to=20floor=5Ftype.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/birth.c | 12 ++++++------ src/bldg.c | 6 +++--- src/cmd/cmd-basic.c | 36 ++++++++++++++++++------------------ src/cmd/cmd-dump.c | 20 ++++++++++---------- src/core.c | 26 +++++++++++++------------- src/dungeon-file.c | 12 ++++++------ src/files.c | 10 +++++----- src/floor-generate.c | 6 +++--- src/floor.h | 1 + src/load.c | 16 ++++++++-------- src/monster1.c | 2 +- src/monster2.c | 2 +- src/mspells1.c | 2 +- src/mspells2.c | 2 +- src/mutation.c | 2 +- src/object-hook.c | 4 ++-- src/player-move.c | 6 +++--- src/player-status.c | 2 +- src/player-status.h | 1 - src/quest.c | 16 ++++++++-------- src/save.c | 2 +- src/spells-floor.c | 6 +++--- src/spells.h | 2 +- src/spells1.c | 2 +- src/spells2.c | 8 ++++---- src/spells3.c | 10 +++++----- src/targeting.c | 6 +++--- src/util.c | 6 +++--- src/view-mainwindow.c | 6 +++--- src/wizard2.c | 12 ++++++------ 30 files changed, 122 insertions(+), 122 deletions(-) diff --git a/src/birth.c b/src/birth.c index 604b12894..0e1381784 100644 --- a/src/birth.c +++ b/src/birth.c @@ -1834,7 +1834,7 @@ static void player_wipe_without_name(player_type *creature_ptr) /* Initialize arena and rewards information -KMW- */ creature_ptr->arena_number = 0; creature_ptr->inside_arena = FALSE; - creature_ptr->inside_quest = 0; + creature_ptr->current_floor_ptr->inside_quest = 0; for (i = 0; i < MAX_MANE; i++) { creature_ptr->mane_spell[i] = -1; @@ -1886,11 +1886,11 @@ static void init_dungeon_quests(player_type *creature_ptr) /* Init the random quests */ init_flags = INIT_ASSIGN; - creature_ptr->inside_quest = MIN_RANDOM_QUEST; + creature_ptr->current_floor_ptr->inside_quest = MIN_RANDOM_QUEST; process_dungeon_file("q_info.txt", 0, 0, 0, 0); - creature_ptr->inside_quest = 0; + creature_ptr->current_floor_ptr->inside_quest = 0; /* Generate quests */ for (i = MIN_RANDOM_QUEST + number_of_quests - 1; i >= MIN_RANDOM_QUEST; i--) @@ -1910,18 +1910,18 @@ static void init_dungeon_quests(player_type *creature_ptr) /* Init the two main quests (Oberon + Serpent) */ init_flags = INIT_ASSIGN; - creature_ptr->inside_quest = QUEST_OBERON; + creature_ptr->current_floor_ptr->inside_quest = QUEST_OBERON; process_dungeon_file("q_info.txt", 0, 0, 0, 0); quest[QUEST_OBERON].status = QUEST_STATUS_TAKEN; - creature_ptr->inside_quest = QUEST_SERPENT; + creature_ptr->current_floor_ptr->inside_quest = QUEST_SERPENT; process_dungeon_file("q_info.txt", 0, 0, 0, 0); quest[QUEST_SERPENT].status = QUEST_STATUS_TAKEN; - creature_ptr->inside_quest = 0; + creature_ptr->current_floor_ptr->inside_quest = 0; } /*! diff --git a/src/bldg.c b/src/bldg.c index 1231d97d1..6624e9b4b 100644 --- a/src/bldg.c +++ b/src/bldg.c @@ -2129,8 +2129,8 @@ static void get_questinfo(IDX questnum, bool do_init) quest_text_line = 0; /* Set the quest number temporary */ - old_quest = p_ptr->inside_quest; - p_ptr->inside_quest = questnum; + old_quest = p_ptr->current_floor_ptr->inside_quest; + p_ptr->current_floor_ptr->inside_quest = questnum; /* Get the quest text */ init_flags = INIT_SHOW_TEXT; @@ -2139,7 +2139,7 @@ static void get_questinfo(IDX questnum, bool do_init) process_dungeon_file("q_info.txt", 0, 0, 0, 0); /* Reset the old quest number */ - p_ptr->inside_quest = old_quest; + p_ptr->current_floor_ptr->inside_quest = old_quest; /* Print the quest info */ sprintf(tmp_str, _("クエスト情報 (危険度: %d 階相当)", "Quest Information (Danger level: %d)"), (int)quest[questnum].level); diff --git a/src/cmd/cmd-basic.c b/src/cmd/cmd-basic.c index 6ad13a2ad..d7046d8c2 100644 --- a/src/cmd/cmd-basic.c +++ b/src/cmd/cmd-basic.c @@ -65,10 +65,10 @@ */ static bool confirm_leave_level(player_type *creature_ptr, bool down_stair) { - quest_type *q_ptr = &quest[creature_ptr->inside_quest]; + quest_type *q_ptr = &quest[creature_ptr->current_floor_ptr->inside_quest]; /* Confirm leaving from once only quest */ - if (confirm_quest && creature_ptr->inside_quest && + if (confirm_quest && creature_ptr->current_floor_ptr->inside_quest && (q_ptr->type == QUEST_TYPE_RANDOM || (q_ptr->flags & QUEST_FLAG_ONCE && q_ptr->status != QUEST_STATUS_COMPLETED) || @@ -219,21 +219,21 @@ void do_cmd_go_up(player_type *creature_ptr) leave_quest_check(); - creature_ptr->inside_quest = g_ptr->special; + creature_ptr->current_floor_ptr->inside_quest = g_ptr->special; /* Activate the quest */ - if (!quest[creature_ptr->inside_quest].status) + if (!quest[creature_ptr->current_floor_ptr->inside_quest].status) { - if (quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM) + if (quest[creature_ptr->current_floor_ptr->inside_quest].type != QUEST_TYPE_RANDOM) { init_flags = INIT_ASSIGN; process_dungeon_file("q_info.txt", 0, 0, 0, 0); } - quest[creature_ptr->inside_quest].status = QUEST_STATUS_TAKEN; + quest[creature_ptr->current_floor_ptr->inside_quest].status = QUEST_STATUS_TAKEN; } /* Leaving a quest */ - if (!creature_ptr->inside_quest) + if (!creature_ptr->current_floor_ptr->inside_quest) { creature_ptr->current_floor_ptr->dun_level = 0; } @@ -264,21 +264,21 @@ void do_cmd_go_up(player_type *creature_ptr) if (autosave_l) do_cmd_save_game(TRUE); /* For a random quest */ - if (creature_ptr->inside_quest && - quest[creature_ptr->inside_quest].type == QUEST_TYPE_RANDOM) + if (creature_ptr->current_floor_ptr->inside_quest && + quest[creature_ptr->current_floor_ptr->inside_quest].type == QUEST_TYPE_RANDOM) { leave_quest_check(); - creature_ptr->inside_quest = 0; + creature_ptr->current_floor_ptr->inside_quest = 0; } /* For a fixed quest */ - if (creature_ptr->inside_quest && - quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM) + if (creature_ptr->current_floor_ptr->inside_quest && + quest[creature_ptr->current_floor_ptr->inside_quest].type != QUEST_TYPE_RANDOM) { leave_quest_check(); - creature_ptr->inside_quest = g_ptr->special; + creature_ptr->current_floor_ptr->inside_quest = g_ptr->special; creature_ptr->current_floor_ptr->dun_level = 0; up_num = 0; } @@ -366,21 +366,21 @@ void do_cmd_go_down(player_type *creature_ptr) leave_quest_check(); leave_tower_check(); - creature_ptr->inside_quest = g_ptr->special; + creature_ptr->current_floor_ptr->inside_quest = g_ptr->special; /* Activate the quest */ - if (!quest[creature_ptr->inside_quest].status) + if (!quest[creature_ptr->current_floor_ptr->inside_quest].status) { - if (quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM) + if (quest[creature_ptr->current_floor_ptr->inside_quest].type != QUEST_TYPE_RANDOM) { init_flags = INIT_ASSIGN; process_dungeon_file("q_info.txt", 0, 0, 0, 0); } - quest[creature_ptr->inside_quest].status = QUEST_STATUS_TAKEN; + quest[creature_ptr->current_floor_ptr->inside_quest].status = QUEST_STATUS_TAKEN; } /* Leaving a quest */ - if (!creature_ptr->inside_quest) + if (!creature_ptr->current_floor_ptr->inside_quest) { creature_ptr->current_floor_ptr->dun_level = 0; } diff --git a/src/cmd/cmd-dump.c b/src/cmd/cmd-dump.c index 04cf6b03d..752142569 100644 --- a/src/cmd/cmd-dump.c +++ b/src/cmd/cmd-dump.c @@ -424,8 +424,8 @@ errr exe_write_diary(player_type *creature_ptr, int type, int num, concptr note) { QUEST_IDX old_quest; - old_quest = creature_ptr->inside_quest; - creature_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num; + old_quest = creature_ptr->current_floor_ptr->inside_quest; + creature_ptr->current_floor_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num; /* Get the quest text */ init_flags = INIT_NAME_ONLY; @@ -433,7 +433,7 @@ errr exe_write_diary(player_type *creature_ptr, int type, int num, concptr note) process_dungeon_file("q_info.txt", 0, 0, 0, 0); /* Reset the old quest number */ - creature_ptr->inside_quest = old_quest; + creature_ptr->current_floor_ptr->inside_quest = old_quest; } /* different filne name to avoid mixing */ @@ -2913,7 +2913,7 @@ void do_cmd_feeling(player_type *creature_ptr) if (creature_ptr->wild_mode) return; /* No useful feeling in quests */ - if (creature_ptr->inside_quest && !random_quest_number(creature_ptr->current_floor_ptr->dun_level)) + if (creature_ptr->current_floor_ptr->inside_quest && !random_quest_number(creature_ptr->current_floor_ptr->dun_level)) { msg_print(_("典型的なクエストのダンジョンのようだ。", "Looks like a typical quest level.")); return; @@ -6454,14 +6454,14 @@ static void do_cmd_knowledge_quests_current(FILE *fff) (quest[i].status == QUEST_STATUS_COMPLETED)) { /* Set the quest number temporary */ - QUEST_IDX old_quest = p_ptr->inside_quest; + QUEST_IDX old_quest = p_ptr->current_floor_ptr->inside_quest; int j; /* Clear the text */ for (j = 0; j < 10; j++) quest_text[j][0] = '\0'; quest_text_line = 0; - p_ptr->inside_quest = i; + p_ptr->current_floor_ptr->inside_quest = i; /* Get the quest text */ init_flags = INIT_SHOW_TEXT; @@ -6469,7 +6469,7 @@ static void do_cmd_knowledge_quests_current(FILE *fff) process_dungeon_file("q_info.txt", 0, 0, 0, 0); /* Reset the old quest number */ - p_ptr->inside_quest = old_quest; + p_ptr->current_floor_ptr->inside_quest = old_quest; /* No info from "silent" quests */ if (quest[i].flags & QUEST_FLAG_SILENT) continue; @@ -6611,9 +6611,9 @@ static bool do_cmd_knowledge_quests_aux(FILE *fff, IDX q_idx) if (is_fixed_quest_idx(q_idx)) { /* Set the quest number temporary */ - IDX old_quest = p_ptr->inside_quest; + IDX old_quest = p_ptr->current_floor_ptr->inside_quest; - p_ptr->inside_quest = q_idx; + p_ptr->current_floor_ptr->inside_quest = q_idx; /* Get the quest */ init_flags = INIT_NAME_ONLY; @@ -6621,7 +6621,7 @@ static bool do_cmd_knowledge_quests_aux(FILE *fff, IDX q_idx) process_dungeon_file("q_info.txt", 0, 0, 0, 0); /* Reset the old quest number */ - p_ptr->inside_quest = old_quest; + p_ptr->current_floor_ptr->inside_quest = old_quest; /* No info from "silent" quests */ if (q_ptr->flags & QUEST_FLAG_SILENT) return FALSE; diff --git a/src/core.c b/src/core.c index 143cc5c0d..2a6dee673 100644 --- a/src/core.c +++ b/src/core.c @@ -674,7 +674,7 @@ static void pattern_teleport(player_type *creature_ptr) if (record_stair) exe_write_diary(creature_ptr, NIKKI_PAT_TELE, 0, NULL); - creature_ptr->inside_quest = 0; + creature_ptr->current_floor_ptr->inside_quest = 0; free_turn(creature_ptr); /* @@ -2955,7 +2955,7 @@ static void process_world_aux_movement(player_type *creature_ptr) disturb(creature_ptr, FALSE, TRUE); /* Determine the level */ - if (floor_ptr->dun_level || creature_ptr->inside_quest || creature_ptr->enter_dungeon) + if (floor_ptr->dun_level || creature_ptr->current_floor_ptr->inside_quest || creature_ptr->enter_dungeon) { msg_print(_("上に引っ張りあげられる感じがする!", "You feel yourself yanked upwards!")); @@ -2969,7 +2969,7 @@ static void process_world_aux_movement(player_type *creature_ptr) leave_quest_check(); leave_tower_check(); - creature_ptr->inside_quest = 0; + creature_ptr->current_floor_ptr->inside_quest = 0; creature_ptr->leaving = TRUE; } @@ -3199,7 +3199,7 @@ static void process_world(void) /*** Handle the wilderness/town (sunshine) ***/ /* While in town/wilderness */ - if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena) + if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->current_floor_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena) { /* Hack -- Daybreak/Nighfall in town */ if (!(current_world_ptr->game_turn % ((TURNS_PER_TICK * TOWN_DAWN) / 2))) @@ -3216,7 +3216,7 @@ static void process_world(void) } /* While in the dungeon (vanilla_town or lite_town mode only) */ - else if ((vanilla_town || (lite_town && !p_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)) && p_ptr->current_floor_ptr->dun_level) + else if ((vanilla_town || (lite_town && !p_ptr->current_floor_ptr->inside_quest && !p_ptr->phase_out && !p_ptr->inside_arena)) && p_ptr->current_floor_ptr->dun_level) { /*** Shuffle the Storekeepers ***/ @@ -3267,7 +3267,7 @@ static void process_world(void) /* Check for creature generation. */ if (one_in_(d_info[p_ptr->dungeon_idx].max_m_alloc_chance) && - !p_ptr->inside_arena && !p_ptr->inside_quest && !p_ptr->phase_out) + !p_ptr->inside_arena && !p_ptr->current_floor_ptr->inside_quest && !p_ptr->phase_out) { /* Make a new monster */ (void)alloc_monster(MAX_SIGHT + 5, 0); @@ -3744,7 +3744,7 @@ static void process_command(player_type *creature_ptr) /* Go up staircase */ case '<': { - if (!creature_ptr->wild_mode && !p_ptr->current_floor_ptr->dun_level && !creature_ptr->inside_arena && !creature_ptr->inside_quest) + if (!creature_ptr->wild_mode && !p_ptr->current_floor_ptr->dun_level && !creature_ptr->inside_arena && !creature_ptr->current_floor_ptr->inside_quest) { if (vanilla_town) break; @@ -4957,7 +4957,7 @@ static void dungeon(bool load_game) /* Track maximum dungeon level (if not in quest -KMW-) */ - if ((max_dlv[p_ptr->dungeon_idx] < p_ptr->current_floor_ptr->dun_level) && !p_ptr->inside_quest) + if ((max_dlv[p_ptr->dungeon_idx] < p_ptr->current_floor_ptr->dun_level) && !p_ptr->current_floor_ptr->inside_quest) { max_dlv[p_ptr->dungeon_idx] = p_ptr->current_floor_ptr->dun_level; if (record_maxdepth) exe_write_diary(p_ptr, NIKKI_MAXDEAPTH, p_ptr->current_floor_ptr->dun_level, NULL); @@ -5016,10 +5016,10 @@ static void dungeon(bool load_game) if (!p_ptr->playing || p_ptr->is_dead) return; /* Print quest message if appropriate */ - if (!p_ptr->inside_quest && (p_ptr->dungeon_idx == DUNGEON_ANGBAND)) + if (!p_ptr->current_floor_ptr->inside_quest && (p_ptr->dungeon_idx == DUNGEON_ANGBAND)) { quest_discovery(random_quest_number(p_ptr->current_floor_ptr->dun_level)); - p_ptr->inside_quest = random_quest_number(p_ptr->current_floor_ptr->dun_level); + p_ptr->current_floor_ptr->inside_quest = random_quest_number(p_ptr->current_floor_ptr->dun_level); } if ((p_ptr->current_floor_ptr->dun_level == d_info[p_ptr->dungeon_idx].maxdepth) && d_info[p_ptr->dungeon_idx].final_guardian) { @@ -5392,7 +5392,7 @@ void play_game(bool new_game) /* Start in town */ p_ptr->current_floor_ptr->dun_level = 0; - p_ptr->inside_quest = 0; + p_ptr->current_floor_ptr->inside_quest = 0; p_ptr->inside_arena = FALSE; p_ptr->phase_out = FALSE; @@ -5488,7 +5488,7 @@ void play_game(bool new_game) init_saved_floors(TRUE); /* Avoid crash */ - p_ptr->inside_quest = 0; + p_ptr->current_floor_ptr->inside_quest = 0; /* Avoid crash in update_view() */ p_ptr->y = p_ptr->x = 10; @@ -5501,7 +5501,7 @@ void play_game(bool new_game) } /* Initialize the town-buildings if necessary */ - if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest) + if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->current_floor_ptr->inside_quest) { process_dungeon_file("w_info.txt", 0, 0, current_world_ptr->max_wild_y, current_world_ptr->max_wild_x); init_flags = INIT_ONLY_BUILDINGS; diff --git a/src/dungeon-file.c b/src/dungeon-file.c index 82f826544..ce9080e6d 100644 --- a/src/dungeon-file.c +++ b/src/dungeon-file.c @@ -3614,9 +3614,9 @@ static errr parse_line_feature(char *buf) } else if (zz[6][0] == '!') { - if (p_ptr->inside_quest) + if (p_ptr->current_floor_ptr->inside_quest) { - letter[index].artifact = quest[p_ptr->inside_quest].k_idx; + letter[index].artifact = quest[p_ptr->current_floor_ptr->inside_quest].k_idx; } } else @@ -3645,9 +3645,9 @@ static errr parse_line_feature(char *buf) } else if (zz[4][0] == '!') { - if (p_ptr->inside_quest) + if (p_ptr->current_floor_ptr->inside_quest) { - ARTIFACT_IDX a_idx = quest[p_ptr->inside_quest].k_idx; + ARTIFACT_IDX a_idx = quest[p_ptr->current_floor_ptr->inside_quest].k_idx; if (a_idx) { artifact_type *a_ptr = &a_info[a_idx]; @@ -4239,7 +4239,7 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in panel_col_min = p_ptr->current_floor_ptr->width; /* Place player in a quest level */ - if (p_ptr->inside_quest) + if (p_ptr->current_floor_ptr->inside_quest) { POSITION py, px; @@ -4613,7 +4613,7 @@ static concptr process_dungeon_file_expr(char **sp, char *fp) /* Current quest number */ else if (streq(b + 1, "QUEST_NUMBER")) { - sprintf(tmp, "%d", p_ptr->inside_quest); + sprintf(tmp, "%d", p_ptr->current_floor_ptr->inside_quest); v = tmp; } diff --git a/src/files.c b/src/files.c index ff8bfe6b6..1855ece44 100644 --- a/src/files.c +++ b/src/files.c @@ -3968,7 +3968,7 @@ void display_player(player_type *creature_ptr, int mode) sprintf(statmsg, "...You were killed by %s in %s.", creature_ptr->died_from, map_name()); #endif } - else if (creature_ptr->inside_quest && is_fixed_quest_idx(creature_ptr->inside_quest)) + else if (creature_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(creature_ptr->current_floor_ptr->inside_quest)) { /* Get the quest text */ /* Bewere that INIT_ASSIGN resets the cur_num. */ @@ -3977,9 +3977,9 @@ void display_player(player_type *creature_ptr, int mode) process_dungeon_file("q_info.txt", 0, 0, 0, 0); #ifdef JP - sprintf(statmsg, "…あなたは、クエスト「%s」で%sに殺された。", quest[creature_ptr->inside_quest].name, creature_ptr->died_from); + sprintf(statmsg, "…あなたは、クエスト「%s」で%sに殺された。", quest[creature_ptr->current_floor_ptr->inside_quest].name, creature_ptr->died_from); #else - sprintf(statmsg, "...You were killed by %s in the quest '%s'.", creature_ptr->died_from, quest[creature_ptr->inside_quest].name); + sprintf(statmsg, "...You were killed by %s in the quest '%s'.", creature_ptr->died_from, quest[creature_ptr->current_floor_ptr->inside_quest].name); #endif } else @@ -3997,7 +3997,7 @@ void display_player(player_type *creature_ptr, int mode) { sprintf(statmsg, _("…あなたは現在、 %s にいる。", "...Now, you are in %s."), map_name()); } - else if (creature_ptr->inside_quest && is_fixed_quest_idx(creature_ptr->inside_quest)) + else if (creature_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(creature_ptr->current_floor_ptr->inside_quest)) { /* Clear the text */ /* Must be done before doing INIT_SHOW_TEXT */ @@ -4012,7 +4012,7 @@ void display_player(player_type *creature_ptr, int mode) process_dungeon_file("q_info.txt", 0, 0, 0, 0); - sprintf(statmsg, _("…あなたは現在、 クエスト「%s」を遂行中だ。", "...Now, you are in the quest '%s'."), quest[creature_ptr->inside_quest].name); + sprintf(statmsg, _("…あなたは現在、 クエスト「%s」を遂行中だ。", "...Now, you are in the quest '%s'."), quest[creature_ptr->current_floor_ptr->inside_quest].name); } else { diff --git a/src/floor-generate.c b/src/floor-generate.c index 773ae4f33..f9934635c 100644 --- a/src/floor-generate.c +++ b/src/floor-generate.c @@ -1229,12 +1229,12 @@ static void generate_fixed_floor(floor_type *floor_ptr) } /* Set the quest level */ - floor_ptr->base_level = quest[p_ptr->inside_quest].level; + floor_ptr->base_level = quest[p_ptr->current_floor_ptr->inside_quest].level; floor_ptr->dun_level = floor_ptr->base_level; floor_ptr->object_level = floor_ptr->base_level; floor_ptr->monster_level = floor_ptr->base_level; - if (record_stair) exe_write_diary(p_ptr, NIKKI_TO_QUEST, p_ptr->inside_quest, NULL); + if (record_stair) exe_write_diary(p_ptr, NIKKI_TO_QUEST, p_ptr->current_floor_ptr->inside_quest, NULL); get_mon_num_prep(get_monster_hook(), NULL); init_flags = INIT_CREATE_DUNGEON; @@ -1427,7 +1427,7 @@ void generate_floor(floor_type *floor_ptr) generate_gambling_arena(floor_ptr, p_ptr); } - else if (p_ptr->inside_quest) + else if (p_ptr->current_floor_ptr->inside_quest) { generate_fixed_floor(floor_ptr); } diff --git a/src/floor.h b/src/floor.h index 7cf974866..a79787a00 100644 --- a/src/floor.h +++ b/src/floor.h @@ -123,6 +123,7 @@ typedef struct { POSITION redraw_x[REDRAW_MAX]; bool monster_noise; + QUEST_IDX inside_quest; /* Inside quest level */ } floor_type; diff --git a/src/load.c b/src/load.c index 87179d0a3..686486a2b 100644 --- a/src/load.c +++ b/src/load.c @@ -1960,7 +1960,7 @@ static void rd_extra(void) } rd_s16b(&tmp16s); p_ptr->inside_arena = (bool)tmp16s; - rd_s16b(&p_ptr->inside_quest); + rd_s16b(&p_ptr->current_floor_ptr->inside_quest); if (z_older_than(10, 3, 5)) p_ptr->phase_out = FALSE; else { @@ -2845,7 +2845,7 @@ static errr rd_dungeon_old(void) } } else if ((g_ptr->feat == OLD_FEAT_QUEST_EXIT) && - (p_ptr->inside_quest == OLD_QUEST_WATER_CAVE)) + (p_ptr->current_floor_ptr->inside_quest == OLD_QUEST_WATER_CAVE)) { g_ptr->feat = feat_up_stair; g_ptr->special = 0; @@ -3158,7 +3158,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr) } } else if ((g_ptr->feat == OLD_FEAT_QUEST_EXIT) && - (p_ptr->inside_quest == OLD_QUEST_WATER_CAVE)) + (p_ptr->current_floor_ptr->inside_quest == OLD_QUEST_WATER_CAVE)) { g_ptr->feat = feat_up_stair; g_ptr->special = 0; @@ -3556,7 +3556,7 @@ static errr rd_savefile_new_aux(void) u16b max_towns_load; u16b max_quests_load; byte max_rquests_load; - s16b old_inside_quest = p_ptr->inside_quest; + s16b old_inside_quest = p_ptr->current_floor_ptr->inside_quest; /* Number of towns */ rd_u16b(&max_towns_load); @@ -3652,10 +3652,10 @@ static errr rd_savefile_new_aux(void) else { init_flags = INIT_ASSIGN; - p_ptr->inside_quest = (QUEST_IDX)i; + p_ptr->current_floor_ptr->inside_quest = (QUEST_IDX)i; process_dungeon_file("q_info.txt", 0, 0, 0, 0); - p_ptr->inside_quest = old_inside_quest; + p_ptr->current_floor_ptr->inside_quest = old_inside_quest; } } else @@ -3961,11 +3961,11 @@ static errr rd_savefile_new_aux(void) /* Quest 18 was removed */ if (h_older_than(1, 7, 0, 6)) { - if (p_ptr->inside_quest == OLD_QUEST_WATER_CAVE) + if (p_ptr->current_floor_ptr->inside_quest == OLD_QUEST_WATER_CAVE) { p_ptr->dungeon_idx = lite_town ? DUNGEON_ANGBAND : DUNGEON_GALGALS; p_ptr->current_floor_ptr->dun_level = 1; - p_ptr->inside_quest = 0; + p_ptr->current_floor_ptr->inside_quest = 0; } } diff --git a/src/monster1.c b/src/monster1.c index 5693b427e..7f903d483 100644 --- a/src/monster1.c +++ b/src/monster1.c @@ -2132,7 +2132,7 @@ void output_monster_spoiler(MONRACE_IDX r_idx, void (*roff_func)(TERM_COLOR attr */ monsterrace_hook_type get_monster_hook(void) { - if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_quest) + if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->current_floor_ptr->inside_quest) { switch (wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].terrain) { diff --git a/src/monster2.c b/src/monster2.c index dd037b848..71657430c 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -1082,7 +1082,7 @@ errr get_mon_num_prep(monsterrace_hook_type monster_hook, /* Accept this monster */ entry->prob2 = entry->prob1; - if (p_ptr->current_floor_ptr->dun_level && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)) && + if (p_ptr->current_floor_ptr->dun_level && (!p_ptr->current_floor_ptr->inside_quest || is_fixed_quest_idx(p_ptr->current_floor_ptr->inside_quest)) && !restrict_monster_to_dungeon(p_ptr->dungeon_idx, entry->index) && !p_ptr->phase_out) { int hoge = entry->prob2 * d_info[p_ptr->dungeon_idx].special_div; diff --git a/src/mspells1.c b/src/mspells1.c index 3dc2b9edf..175b5cf06 100644 --- a/src/mspells1.c +++ b/src/mspells1.c @@ -1383,7 +1383,7 @@ bool make_attack_spell(MONSTER_IDX m_idx) bool direct; bool in_no_magic_dungeon = (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && p_ptr->current_floor_ptr->dun_level - && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)); + && (!p_ptr->current_floor_ptr->inside_quest || is_fixed_quest_idx(p_ptr->current_floor_ptr->inside_quest)); bool can_use_lite_area = FALSE; diff --git a/src/mspells2.c b/src/mspells2.c index 112ab9391..0daa23fb1 100644 --- a/src/mspells2.c +++ b/src/mspells2.c @@ -297,7 +297,7 @@ bool monst_spell_monst(MONSTER_IDX m_idx) bool pet = is_pet(m_ptr); bool in_no_magic_dungeon = (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && p_ptr->current_floor_ptr->dun_level - && (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest)); + && (!p_ptr->current_floor_ptr->inside_quest || is_fixed_quest_idx(p_ptr->current_floor_ptr->inside_quest)); bool can_use_lite_area = FALSE; bool can_remember; diff --git a/src/mutation.c b/src/mutation.c index 6995ef986..0aa6c6f33 100644 --- a/src/mutation.c +++ b/src/mutation.c @@ -2312,7 +2312,7 @@ bool exe_mutation_power(player_type *creature_ptr, int power) if ((r_ptr->flags3 & RF3_EVIL) && !(r_ptr->flags1 & RF1_QUESTOR) && !(r_ptr->flags1 & RF1_UNIQUE) && - !creature_ptr->inside_arena && !creature_ptr->inside_quest && + !creature_ptr->inside_arena && !creature_ptr->current_floor_ptr->inside_quest && (r_ptr->level < randint1(creature_ptr->lev+50)) && !(m_ptr->mflag2 & MFLAG2_NOGENO)) { diff --git a/src/object-hook.c b/src/object-hook.c index 245ec9566..ff43b3941 100644 --- a/src/object-hook.c +++ b/src/object-hook.c @@ -949,9 +949,9 @@ bool can_player_destroy_object(object_type *o_ptr) */ bool object_is_quest_target(object_type *o_ptr) { - if (p_ptr->inside_quest) + if (p_ptr->current_floor_ptr->inside_quest) { - ARTIFACT_IDX a_idx = quest[p_ptr->inside_quest].k_idx; + ARTIFACT_IDX a_idx = quest[p_ptr->current_floor_ptr->inside_quest].k_idx; if (a_idx) { artifact_type *a_ptr = &a_info[a_idx]; diff --git a/src/player-move.c b/src/player-move.c index 7594a47e0..06d8d3320 100644 --- a/src/player-move.c +++ b/src/player-move.c @@ -750,14 +750,14 @@ bool move_player_effect(player_type *creature_ptr, POSITION ny, POSITION nx, BIT else if (have_flag(f_ptr->flags, FF_QUEST_EXIT)) { - if (quest[creature_ptr->inside_quest].type == QUEST_TYPE_FIND_EXIT) + if (quest[creature_ptr->current_floor_ptr->inside_quest].type == QUEST_TYPE_FIND_EXIT) { - complete_quest(creature_ptr->inside_quest); + complete_quest(creature_ptr->current_floor_ptr->inside_quest); } leave_quest_check(); - creature_ptr->inside_quest = g_ptr->special; + creature_ptr->current_floor_ptr->inside_quest = g_ptr->special; p_ptr->current_floor_ptr->dun_level = 0; creature_ptr->oldpx = 0; creature_ptr->oldpy = 0; diff --git a/src/player-status.c b/src/player-status.c index c53077e90..d80a65aec 100644 --- a/src/player-status.c +++ b/src/player-status.c @@ -5850,7 +5850,7 @@ void cheat_death(player_type *creature_ptr) creature_ptr->inside_arena = FALSE; creature_ptr->phase_out = FALSE; leaving_quest = 0; - creature_ptr->inside_quest = 0; + creature_ptr->current_floor_ptr->inside_quest = 0; if (creature_ptr->dungeon_idx) creature_ptr->recall_dungeon = creature_ptr->dungeon_idx; creature_ptr->dungeon_idx = 0; if (lite_town || vanilla_town) diff --git a/src/player-status.h b/src/player-status.h index c1e0ba3b5..59ece6809 100644 --- a/src/player-status.h +++ b/src/player-status.h @@ -124,7 +124,6 @@ struct player_type TOWN_IDX town_num; /* Current town number */ s16b arena_number; /* monster number in arena -KMW- */ bool inside_arena; /* Is character inside arena? */ - QUEST_IDX inside_quest; /* Inside quest level */ bool phase_out; /*!< フェイズアウト状態(闘技場観戦状態などに利用、NPCの処理の対象にならず自身もほとんどの行動ができない) */ DUNGEON_IDX dungeon_idx; /* current dungeon index */ diff --git a/src/quest.c b/src/quest.c index 52f70ab5d..9f168113a 100644 --- a/src/quest.c +++ b/src/quest.c @@ -130,7 +130,7 @@ void check_quest_completion(monster_type *m_ptr) x = m_ptr->fx; /* Inside a quest */ - quest_num = p_ptr->inside_quest; + quest_num = p_ptr->current_floor_ptr->inside_quest; /* Search for an active quest on this dungeon level */ if (!quest_num) @@ -229,7 +229,7 @@ void check_quest_completion(monster_type *m_ptr) if (!(q_ptr->flags & QUEST_FLAG_PRESET)) { create_stairs = TRUE; - p_ptr->inside_quest = 0; + p_ptr->current_floor_ptr->inside_quest = 0; } /* Finish the two main quests without rewarding */ @@ -399,8 +399,8 @@ QUEST_IDX quest_number(DEPTH level) QUEST_IDX i; /* Check quests */ - if (p_ptr->inside_quest) - return (p_ptr->inside_quest); + if (p_ptr->current_floor_ptr->inside_quest) + return (p_ptr->current_floor_ptr->inside_quest); for (i = 0; i < max_q_idx; i++) { @@ -449,7 +449,7 @@ QUEST_IDX random_quest_number(DEPTH level) void leave_quest_check(void) { /* Save quest number for dungeon pref file ($LEAVING_QUEST) */ - leaving_quest = p_ptr->inside_quest; + leaving_quest = p_ptr->current_floor_ptr->inside_quest; /* Leaving an 'only once' quest marks it as failed */ if (leaving_quest) @@ -501,7 +501,7 @@ void leave_quest_check(void) */ void leave_tower_check(void) { - leaving_quest = p_ptr->inside_quest; + leaving_quest = p_ptr->current_floor_ptr->inside_quest; /* Check for Tower Quest */ if (leaving_quest && (quest[leaving_quest].type == QUEST_TYPE_TOWER) && @@ -547,8 +547,8 @@ void do_cmd_quest(void) leave_quest_check(); - if (quest[p_ptr->inside_quest].type != QUEST_TYPE_RANDOM) p_ptr->current_floor_ptr->dun_level = 1; - p_ptr->inside_quest = p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special; + if (quest[p_ptr->current_floor_ptr->inside_quest].type != QUEST_TYPE_RANDOM) p_ptr->current_floor_ptr->dun_level = 1; + p_ptr->current_floor_ptr->inside_quest = p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special; p_ptr->leaving = TRUE; } diff --git a/src/save.c b/src/save.c index c7a64978f..cea62422b 100644 --- a/src/save.c +++ b/src/save.c @@ -693,7 +693,7 @@ static void wr_extra(void) /* Write arena and rewards information -KMW- */ wr_s16b(p_ptr->arena_number); wr_s16b(p_ptr->inside_arena); - wr_s16b(p_ptr->inside_quest); + wr_s16b(p_ptr->current_floor_ptr->inside_quest); wr_s16b(p_ptr->phase_out); wr_byte(p_ptr->exit_bldg); wr_byte(0); /* Unused */ diff --git a/src/spells-floor.c b/src/spells-floor.c index dc5fc512b..d08084c84 100644 --- a/src/spells-floor.c +++ b/src/spells-floor.c @@ -282,7 +282,7 @@ void stair_creation(player_type *caster_ptr) /* No effect out of standard dungeon floor */ if (!floor_ptr->dun_level || (!up && !down) || - (caster_ptr->inside_quest && is_fixed_quest_idx(caster_ptr->inside_quest)) || + (caster_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(caster_ptr->current_floor_ptr->inside_quest)) || caster_ptr->inside_arena || caster_ptr->phase_out) { /* arena or quest */ @@ -472,7 +472,7 @@ bool destroy_area(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION r, b bool flag = FALSE; /* Prevent destruction of quest levels and town */ - if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !floor_ptr->dun_level) + if ((p_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(p_ptr->current_floor_ptr->inside_quest)) || !floor_ptr->dun_level) { return (FALSE); } @@ -756,7 +756,7 @@ bool earthquake(player_type *caster_ptr, POSITION cy, POSITION cx, POSITION r, M bool map[32][32]; /* Prevent destruction of quest levels and town */ - if ((caster_ptr->inside_quest && is_fixed_quest_idx(caster_ptr->inside_quest)) || !caster_ptr->current_floor_ptr->dun_level) + if ((caster_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(caster_ptr->current_floor_ptr->inside_quest)) || !caster_ptr->current_floor_ptr->dun_level) { return (FALSE); } diff --git a/src/spells.h b/src/spells.h index 90790070f..f1380967b 100644 --- a/src/spells.h +++ b/src/spells.h @@ -332,7 +332,7 @@ extern int project_length; /* Is "teleport level" ineffective to this target? */ #define TELE_LEVEL_IS_INEFF(TARGET) \ (p_ptr->inside_arena || p_ptr->phase_out || \ - (p_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || \ + (p_ptr->current_floor_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || \ (((TARGET) <= 0) && (quest_number(p_ptr->current_floor_ptr->dun_level) || (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) && \ (p_ptr->current_floor_ptr->dun_level >= 1) && ironman_downward)) diff --git a/src/spells1.c b/src/spells1.c index 8649df7a7..bf9817b68 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -3313,7 +3313,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P case GF_CAPTURE: { int nokori_hp; - if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) || + if ((p_ptr->current_floor_ptr->inside_quest && (quest[p_ptr->current_floor_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) || (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_NAZGUL)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR) || m_ptr->parent_m_idx) { msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name); diff --git a/src/spells2.c b/src/spells2.c index 582f869b0..3f2a336ef 100644 --- a/src/spells2.c +++ b/src/spells2.c @@ -1034,7 +1034,7 @@ bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE; else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE; else if (m_idx == p_ptr->riding) resist = TRUE; - else if ((p_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) resist = TRUE; + else if ((p_ptr->current_floor_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) resist = TRUE; else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE; else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE; @@ -1113,7 +1113,7 @@ bool symbol_genocide(int power, bool player_cast) bool result = FALSE; /* Prevent genocide in quest levels */ - if ((p_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) + if ((p_ptr->current_floor_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) { msg_print(_("何も起きないようだ……", "It seems nothing happen here...")); return (FALSE); @@ -1157,7 +1157,7 @@ bool mass_genocide(int power, bool player_cast) bool result = FALSE; /* Prevent mass genocide in quest levels */ - if ((p_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) + if ((p_ptr->current_floor_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) { return (FALSE); } @@ -1197,7 +1197,7 @@ bool mass_genocide_undead(int power, bool player_cast) bool result = FALSE; /* Prevent mass genocide in quest levels */ - if ((p_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) + if ((p_ptr->current_floor_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) { return (FALSE); } diff --git a/src/spells3.c b/src/spells3.c index 85bdf2505..cd173b825 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -124,7 +124,7 @@ bool teleport_away(player_type *caster_ptr, MONSTER_IDX m_idx, POSITION dis, BIT if (!cave_monster_teleportable_bold(m_idx, ny, nx, mode)) continue; /* No teleporting into vaults and such */ - if (!(caster_ptr->inside_quest || caster_ptr->inside_arena)) + if (!(caster_ptr->current_floor_ptr->inside_quest || caster_ptr->inside_arena)) if (caster_ptr->current_floor_ptr->grid_array[ny][nx].info & CAVE_ICKY) continue; /* This grid looks good */ @@ -713,7 +713,7 @@ void teleport_level(player_type *creature_ptr, MONSTER_IDX m_idx) prepare_change_floor_mode(CFM_SAVE_FLOORS | CFM_UP | CFM_RAND_PLACE | CFM_RAND_CONNECT); leave_quest_check(); - creature_ptr->inside_quest = 0; + creature_ptr->current_floor_ptr->inside_quest = 0; creature_ptr->leaving = TRUE; } } @@ -797,7 +797,7 @@ bool recall_player(player_type *creature_ptr, TIME_EFFECT turns) return TRUE; } - if (p_ptr->current_floor_ptr->dun_level && (max_dlv[p_ptr->dungeon_idx] > p_ptr->current_floor_ptr->dun_level) && !creature_ptr->inside_quest && !creature_ptr->word_recall) + if (p_ptr->current_floor_ptr->dun_level && (max_dlv[p_ptr->dungeon_idx] > p_ptr->current_floor_ptr->dun_level) && !creature_ptr->current_floor_ptr->inside_quest && !creature_ptr->word_recall) { if (get_check(_("ここは最深到達階より浅い階です。この階に戻って来ますか? ", "Reset recall depth? "))) { @@ -1041,7 +1041,7 @@ static bool vanish_dungeon(floor_type *floor_ptr, player_type *subject_ptr) GAME_TEXT m_name[MAX_NLEN]; /* Prevent vasishing of quest levels and town */ - if ((subject_ptr->inside_quest && is_fixed_quest_idx(subject_ptr->inside_quest)) || !floor_ptr->dun_level) + if ((subject_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(subject_ptr->current_floor_ptr->inside_quest)) || !floor_ptr->dun_level) { return FALSE; } @@ -1201,7 +1201,7 @@ void call_the_void(player_type *caster_ptr) } /* Prevent destruction of quest levels and town */ - else if ((caster_ptr->inside_quest && is_fixed_quest_idx(caster_ptr->inside_quest)) || !caster_ptr->current_floor_ptr->dun_level) + else if ((caster_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(caster_ptr->current_floor_ptr->inside_quest)) || !caster_ptr->current_floor_ptr->dun_level) { msg_print(_("地面が揺れた。", "The ground trembles.")); } diff --git a/src/targeting.c b/src/targeting.c index 576ad102f..7d560e24e 100644 --- a/src/targeting.c +++ b/src/targeting.c @@ -898,14 +898,14 @@ static char target_set_aux(player_type *subject_ptr, POSITION y, POSITION x, BIT if (have_flag(f_ptr->flags, FF_QUEST_ENTER)) { /* Set the quest number temporary */ - IDX old_quest = subject_ptr->inside_quest; + IDX old_quest = subject_ptr->current_floor_ptr->inside_quest; int j; /* Clear the text */ for (j = 0; j < 10; j++) quest_text[j][0] = '\0'; quest_text_line = 0; - subject_ptr->inside_quest = g_ptr->special; + subject_ptr->current_floor_ptr->inside_quest = g_ptr->special; /* Get the quest text */ init_flags = INIT_NAME_ONLY; @@ -916,7 +916,7 @@ static char target_set_aux(player_type *subject_ptr, POSITION y, POSITION x, BIT quest[g_ptr->special].name, quest[g_ptr->special].level); /* Reset the old quest number */ - subject_ptr->inside_quest = old_quest; + subject_ptr->current_floor_ptr->inside_quest = old_quest; } /* Hack -- special handling for building doors */ diff --git a/src/util.c b/src/util.c index dbe73652c..95e809b82 100644 --- a/src/util.c +++ b/src/util.c @@ -1822,9 +1822,9 @@ void select_floor_music(player_type *player_ptr) if (!play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BATTLE)) return; } - if(player_ptr->inside_quest) + if(player_ptr->current_floor_ptr->inside_quest) { - if (!play_music(TERM_XTRA_MUSIC_QUEST, player_ptr->inside_quest)) return; + if (!play_music(TERM_XTRA_MUSIC_QUEST, player_ptr->current_floor_ptr->inside_quest)) return; if (!play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_QUEST)) return; } @@ -4340,7 +4340,7 @@ static char inkey_from_menu(void) if (p_ptr->pclass == special_menu_info[hoge].jouken_naiyou) menu_name = special_menu_info[hoge].name; break; case MENU_WILD: - if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_arena && !p_ptr->inside_quest) + if (!p_ptr->current_floor_ptr->dun_level && !p_ptr->inside_arena && !p_ptr->current_floor_ptr->inside_quest) { if ((byte)p_ptr->wild_mode == special_menu_info[hoge].jouken_naiyou) menu_name = special_menu_info[hoge].name; } diff --git a/src/view-mainwindow.c b/src/view-mainwindow.c index 4bf471da6..b341b2d27 100644 --- a/src/view-mainwindow.c +++ b/src/view-mainwindow.c @@ -190,8 +190,8 @@ void prt_time(void) */ concptr map_name(void) { - if (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest) - && (quest[p_ptr->inside_quest].flags & QUEST_FLAG_PRESET)) + if (p_ptr->current_floor_ptr->inside_quest && is_fixed_quest_idx(p_ptr->current_floor_ptr->inside_quest) + && (quest[p_ptr->current_floor_ptr->inside_quest].flags & QUEST_FLAG_PRESET)) return _("クエスト", "Quest"); else if (p_ptr->wild_mode) return _("地上", "Surface"); @@ -974,7 +974,7 @@ static void prt_depth(void) { strcpy(depths, _("地上", "Surf.")); } - else if (p_ptr->inside_quest && !p_ptr->dungeon_idx) + else if (p_ptr->current_floor_ptr->inside_quest && !p_ptr->dungeon_idx) { strcpy(depths, _("地上", "Quest")); } diff --git a/src/wizard2.c b/src/wizard2.c index 4e4b62e98..ff1a7dfb5 100644 --- a/src/wizard2.c +++ b/src/wizard2.c @@ -1447,7 +1447,7 @@ static void do_cmd_wiz_jump(player_type *creature_ptr) if (record_stair) exe_write_diary(creature_ptr, NIKKI_WIZ_TELE,0,NULL); - creature_ptr->inside_quest = 0; + creature_ptr->current_floor_ptr->inside_quest = 0; free_turn(creature_ptr); /* Prevent energy_need from being too lower than 0 */ @@ -1936,20 +1936,20 @@ void do_cmd_debug(player_type *creature_ptr) if(tmp_int < 0) break; if(tmp_int >= max_q_idx) break; - creature_ptr->inside_quest = (QUEST_IDX)tmp_int; + creature_ptr->current_floor_ptr->inside_quest = (QUEST_IDX)tmp_int; process_dungeon_file("q_info.txt", 0, 0, 0, 0); quest[tmp_int].status = QUEST_STATUS_TAKEN; - creature_ptr->inside_quest = 0; + creature_ptr->current_floor_ptr->inside_quest = 0; } break; /* Complete a Quest -KMW- */ case 'q': - if(creature_ptr->inside_quest) + if(creature_ptr->current_floor_ptr->inside_quest) { - if (quest[creature_ptr->inside_quest].status == QUEST_STATUS_TAKEN) + if (quest[creature_ptr->current_floor_ptr->inside_quest].status == QUEST_STATUS_TAKEN) { - complete_quest(creature_ptr->inside_quest); + complete_quest(creature_ptr->current_floor_ptr->inside_quest); break; } } -- 2.11.0