summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-22 11:25:01 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-22 11:25:01 +0000
commitf00872b7a53d4b7d0aa8eb8b769f88b9abe5f830 (patch)
treef0c6e0522d23a32ffcb2599fb33cf6b02c2f758b /crawl-ref/source/misc.cc
parent50dd7b84736b4c1c87908cae1030419f773e638d (diff)
downloadcrawl-ref-f00872b7a53d4b7d0aa8eb8b769f88b9abe5f830.tar.gz
crawl-ref-f00872b7a53d4b7d0aa8eb8b769f88b9abe5f830.zip
[2615112] Fix portal vaults sharing ghosts. Ghosts are now saved into bones.XXX where XXX is set from the 'dstext' property of the portal, or to the first three letters of the 'dst' property.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9148 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 5b4300013c..b67114cf6d 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1304,6 +1304,10 @@ static void leaving_level_now()
const std::string newtype =
env.markers.property_at(you.pos(), MAT_ANY, "dst");
+ // Extension to use for bones files.
+ const std::string newext =
+ env.markers.property_at(you.pos(), MAT_ANY, "dstext");
+
const std::string oldname = you.level_type_name;
std::string newname =
env.markers.property_at(you.pos(), MAT_ANY, "dstname");
@@ -1357,6 +1361,7 @@ static void leaving_level_now()
{
you.level_type_tag = newtype;
}
+
const std::string spaced_tag = replace_all(you.level_type_tag, "_", " ");
if (!you.level_type_tag.empty() && you.level_type_name.empty())
@@ -1378,6 +1383,14 @@ static void leaving_level_now()
}
}
+ if (!newext.empty())
+ you.level_type_ext = newext;
+ else if (!you.level_type_tag.empty())
+ you.level_type_ext = lowercase_string(you.level_type_tag);
+
+ if (you.level_type_ext.length() > 3)
+ you.level_type_ext = you.level_type_ext.substr(0, 3);
+
if (!neworigin.empty())
you.level_type_origin = neworigin;
else if (!you.level_type_name.empty())