From f00872b7a53d4b7d0aa8eb8b769f88b9abe5f830 Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 22 Feb 2009 11:25:01 +0000 Subject: [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 --- crawl-ref/source/misc.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'crawl-ref/source/misc.cc') 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()) -- cgit v1.2.3-54-g00ecf