summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-18 14:59:13 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-18 14:59:13 +0000
commitcb1d25a9a8371edb63bc1721b616df12c4e790c2 (patch)
tree08768aa7dae105247c3a8acf30b4537b7aa93747
parent564115dd01a10153ad421df67b1b008fe514cf0c (diff)
downloadcrawl-ref-cb1d25a9a8371edb63bc1721b616df12c4e790c2.tar.gz
crawl-ref-cb1d25a9a8371edb63bc1721b616df12c4e790c2.zip
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
-rw-r--r--crawl-ref/source/directn.cc5
-rw-r--r--crawl-ref/source/dungeon.cc7
-rw-r--r--crawl-ref/source/travel.cc10
-rw-r--r--crawl-ref/source/travel.h2
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<int> stair(cleaned_feature_description(grid), 1);
+ const named_thing<int> stair(cleaned_feature_description(pos), 1);
add_stair(stair);
es_flags |= ES_STAIR;
}
else if (grid_is_portal(grid) && ES_portal)
{
- const named_thing<int> portal(cleaned_feature_description(grid), 1);
+ const named_thing<int> 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<int> altar(cleaned_feature_description(grid), 1);
+ const named_thing<int> 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 <class C> void say_any(const C &coll, const char *stub) const;
template <class citer> 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<int> &stair);
std::vector<std::string> apply_quantities(