diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-05 01:26:53 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-05 01:26:53 +0000 |
commit | e92999f1200f022ac4b031dbf258de7e1e450bb4 (patch) | |
tree | 19b9592aa320109c087c34954a1f0cb27e5032c2 /crawl-ref/source/tags.cc | |
parent | 5f0ddf6624733f0961e643ea93a84422ab2040b2 (diff) | |
download | crawl-ref-e92999f1200f022ac4b031dbf258de7e1e450bb4.tar.gz crawl-ref-e92999f1200f022ac4b031dbf258de7e1e450bb4.zip |
Adding SVN revision number (and build date) into .sav files.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8220 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r-- | crawl-ref/source/tags.cc | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 4076537e15..d058d2e782 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -1032,17 +1032,30 @@ static void tag_construct_you(writer &th) for (unsigned int k = 0; k < you.mesmerised_by.size(); k++) marshallByte(th, you.mesmerised_by[k]); - // minorVersion 2 starts here + // minorVersion TAG_MINOR_PIETY starts here marshallByte(th, you.piety_hysteresis); - // minorVersion 3 starts here + // minorVersion TAG_MINOR_QUIVER starts here you.m_quiver->save(th); - // minorVersion 7 starts here + // minorVersion TAG_MINOR_FPICKUP starts here marshallByte(th, you.friendly_pickup); + // minorVersion TAG_MINOR_LUADGN starts here if (!dlua.callfn("dgn_save_data", "u", &th)) mprf(MSGCH_ERROR, "Failed to save Lua data: %s", dlua.error.c_str()); + + // minorVersion TAG_MINOR_SVNREV starts here + // Write a human-readable string out on the off chance that + // we fail to be able to read this file back in using some later version. + std::string revision = "SVN:"; + revision += number_to_string(svn_revision()); + revision += ":"; + revision += VERSION_DETAIL; + marshallString(th, revision); + marshallLong(th, svn_revision()); + + printf("REVSAVE: (%s), (%d)\n", revision.c_str(), svn_revision()); } static void tag_construct_you_items(writer &th) @@ -1459,6 +1472,15 @@ static void tag_read_you(reader &th, char minorVersion) mprf(MSGCH_ERROR, "Failed to load Lua persist table: %s", dlua.error.c_str()); } + + if (minorVersion >= TAG_MINOR_SVNREV) + { + std::string rev_str = unmarshallString(th); + int rev_int = unmarshallLong(th); + + UNUSED(rev_str); + UNUSED(rev_int); + } } static void tag_read_you_items(reader &th, char minorVersion) |