summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-21 18:32:15 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-21 18:32:15 +0000
commitd9ea3d23c7f996b76d1663272e48b8ce5698d08d (patch)
treeadcc762851560abb08d6ffba5e6b0138186de7c1
parenta827d0a2fe6398a6262bc7a41318afbd26f18847 (diff)
downloadcrawl-ref-d9ea3d23c7f996b76d1663272e48b8ce5698d08d.tar.gz
crawl-ref-d9ea3d23c7f996b76d1663272e48b8ce5698d08d.zip
Fix [2700197]: Use "a" instead of "an" for one-headed hydras.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9525 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/libutil.cc4
-rw-r--r--crawl-ref/source/mon-util.cc20
2 files changed, 13 insertions, 11 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index 2c264313f0..1cc7f40d85 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -292,7 +292,7 @@ std::string article_a(const std::string &name, bool lowercase)
case 'a': case 'e': case 'i': case 'o': case 'u':
case 'A': case 'E': case 'I': case 'O': case 'U':
// XXX: Hack
- if (starts_with(name, "one-way"))
+ if (starts_with(name, "one-"))
return a + name;
return an + name;
default:
@@ -353,7 +353,7 @@ std::string pluralise(const std::string &name,
{
if (name == "y")
return ("ys");
- // sensibilitiy -> sensibilities
+ // sensibility -> sensibilities
else if (name[name.length() - 2] == 'i')
return name.substr(0, name.length() - 1) + "es";
// day -> days, boy -> boys, etc
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index 5fb06eddb7..ac0a59680e 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -2116,10 +2116,7 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
result += cardinals[mon.number - 1];
}
else
- {
- snprintf(info, INFO_SIZE, "%d", mon.number);
- result += info;
- }
+ result += make_stringf("%d", mon.number);
result += "-headed ";
}
@@ -2156,11 +2153,13 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
break;
}
- // Vowel fix: Change 'a orc' to 'an orc'
+ // Vowel fix: Change 'a orc' to 'an orc'.
if (result.length() >= 3
&& (result[0] == 'a' || result[0] == 'A')
&& result[1] == ' '
- && is_vowel(result[2]))
+ && is_vowel(result[2])
+ // XXX: Hack
+ && !starts_with(&result[2], "one-"))
{
result.insert(1, "n");
}
@@ -2189,6 +2188,7 @@ static std::string _str_monam(const monsters& mon, description_level_type desc,
std::string mons_type_name(int type, description_level_type desc )
{
std::string result;
+
if (!mons_is_unique(type))
{
switch (desc)
@@ -2201,7 +2201,7 @@ std::string mons_type_name(int type, description_level_type desc )
}
}
- switch(type)
+ switch (type)
{
case RANDOM_MONSTER:
result += "random monster";
@@ -2230,11 +2230,13 @@ std::string mons_type_name(int type, description_level_type desc )
result += me->name;
- // Vowel fix: Change 'a orc' to 'an orc'.
+ // Vowel fix: Change 'a orc' to 'an orc'..
if (result.length() >= 3
&& (result[0] == 'a' || result[0] == 'A')
&& result[1] == ' '
- && is_vowel(result[2]) )
+ && is_vowel(result[2])
+ // XXX: Hack
+ && !starts_with(&result[2], "one-"))
{
result.insert(1, "n");
}