summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.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/files.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/files.cc')
-rw-r--r--crawl-ref/source/files.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 070076e706..ecaa0c1abf 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -1540,11 +1540,16 @@ void save_game_state()
save_game(true);
}
+static std::string _make_portal_vault_ghost_suffix()
+{
+ return you.level_type_ext.empty()? "ptl" : you.level_type_ext;
+}
+
static std::string _make_ghost_filename()
{
if (you.level_type == LEVEL_PORTAL_VAULT)
{
- std::string suffix = "ptl";
+ const std::string suffix = _make_portal_vault_ghost_suffix();
return get_savedir_filename("bones", "", suffix, true);
}
else
@@ -1602,7 +1607,7 @@ void _load_ghost(void)
fclose(gfile);
#if DEBUG_DIAGNOSTICS
- mpr( "Loaded ghost.", MSGCH_DIAGNOSTICS );
+ mpr( "Loaded ghost.", MSGCH_DIAGNOSTICS );
#endif
// Remove bones file - ghosts are hardly permanent.
@@ -1935,7 +1940,7 @@ void save_ghost( bool force )
lk_close(gfile, "wb", cha_fil);
#if DEBUG_DIAGNOSTICS
- mpr( "Saved ghost.", MSGCH_DIAGNOSTICS );
+ mprf(MSGCH_DIAGNOSTICS, "Saved ghost (%s).", cha_fil.c_str() );
#endif
DO_CHMOD_PRIVATE(cha_fil.c_str());