From cb1d25a9a8371edb63bc1721b616df12c4e790c2 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Tue, 18 Nov 2008 14:59:13 +0000 Subject: Use the correct portal description in explore stop messages. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7475 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/directn.cc | 5 +++-- crawl-ref/source/dungeon.cc | 7 ++++++- crawl-ref/source/travel.cc | 10 +++++----- crawl-ref/source/travel.h | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 29ec859c09..9002ca9f4b 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -2480,8 +2480,9 @@ std::string raw_feature_description(dungeon_feature_type grid, case DNGN_ENTER_SHOALS: return ("staircase to the Shoals"); case DNGN_ENTER_PORTAL_VAULT: -// return ("gate leading to a distant place"); - return ("gateway to a bazaar"); + // The bazaar description should be set in the bazaar marker; this + // is the description for a portal of unknown type. + return ("gate leading to a distant place"); case DNGN_EXIT_PORTAL_VAULT: return ("gate leading back to the Dungeon"); case DNGN_RETURN_FROM_ORCISH_MINES: diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index a8733319e1..b3e0da01d6 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -2238,7 +2238,12 @@ static builder_rc_type _builder_by_type(int level_number, char level_type) static void _portal_vault_level(int level_number) { - std::string trimmed_name = trimmed_string(you.level_type_name); + // level_type_name may contain spaces for human readability, but the + // corresponding vault tag name cannot use spaces, so force spaces to + // _ when searching for the tag. + const std::string trimmed_name = + replace_all(trimmed_string(you.level_type_name), " ", "_"); + ASSERT(!trimmed_name.empty()); const char* level_name = trimmed_name.c_str(); diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc index 7a4c4724ea..9d11cdb4b9 100644 --- a/crawl-ref/source/travel.cc +++ b/crawl-ref/source/travel.cc @@ -4030,9 +4030,9 @@ explore_discoveries::explore_discoveries() } std::string explore_discoveries::cleaned_feature_description( - dungeon_feature_type grid) const + const coord_def &pos) const { - std::string s = lowercase_first(feature_description(grid)); + std::string s = lowercase_first(feature_description(pos)); if (s.length() && s[s.length() - 1] == '.') s.erase(s.length() - 1); if (s.find("a ") != std::string::npos) @@ -4066,13 +4066,13 @@ void explore_discoveries::found_feature(const coord_def &pos, } else if (is_stair(grid) && ES_stair) { - const named_thing stair(cleaned_feature_description(grid), 1); + const named_thing stair(cleaned_feature_description(pos), 1); add_stair(stair); es_flags |= ES_STAIR; } else if (grid_is_portal(grid) && ES_portal) { - const named_thing portal(cleaned_feature_description(grid), 1); + const named_thing portal(cleaned_feature_description(pos), 1); add_stair(portal); es_flags |= ES_PORTAL; } @@ -4080,7 +4080,7 @@ void explore_discoveries::found_feature(const coord_def &pos, && ES_altar && !player_in_branch(BRANCH_ECUMENICAL_TEMPLE)) { - const named_thing altar(cleaned_feature_description(grid), 1); + const named_thing altar(cleaned_feature_description(pos), 1); if (!merge_feature(altars, altar)) altars.push_back(altar); es_flags |= ES_ALTAR; diff --git a/crawl-ref/source/travel.h b/crawl-ref/source/travel.h index d581b1afd9..9f998ec188 100644 --- a/crawl-ref/source/travel.h +++ b/crawl-ref/source/travel.h @@ -390,7 +390,7 @@ private: template void say_any(const C &coll, const char *stub) const; template bool has_duplicates(citer, citer) const; - std::string cleaned_feature_description(dungeon_feature_type feature) const; + std::string cleaned_feature_description(const coord_def &) const; void add_item(const item_def &item); void add_stair(const named_thing &stair); std::vector apply_quantities( -- cgit v1.2.3-54-g00ecf