diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-04-17 20:18:41 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-04-17 20:18:41 +0000 |
commit | 4758caffda6ea00f6d4f83e58a2ae98d2d0f35a7 (patch) | |
tree | 6f782624ed21c83732c9ac48d819879557793828 /crawl-ref/source/tags.cc | |
parent | 1f8a899b0ae700a07df8ccf1165a093ab28a86ad (diff) | |
download | crawl-ref-4758caffda6ea00f6d4f83e58a2ae98d2d0f35a7.tar.gz crawl-ref-4758caffda6ea00f6d4f83e58a2ae98d2d0f35a7.zip |
Since making player ghosts retain their religions breaks binary
compatibility with previous bones files, increase the minor version
number of bones files.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9614 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r-- | crawl-ref/source/tags.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 72bbfb85f2..3f64344891 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -187,7 +187,7 @@ static void tag_construct_ghost(writer &th); static void tag_read_ghost(reader &th, char minorVersion); static void marshallGhost(writer &th, const ghost_demon &ghost); -static ghost_demon unmarshallGhost(reader &th); +static ghost_demon unmarshallGhost(reader &th, char minorVersion); static void marshallResists(writer &, const mon_resist_def &); static void unmarshallResists(reader &, mon_resist_def &); @@ -2175,7 +2175,7 @@ static void unmarshall_monster(reader &th, monsters &m) m.god = static_cast<god_type>( unmarshallByte(th) ); if (m.type == MONS_PLAYER_GHOST || m.type == MONS_PANDEMONIUM_DEMON) - m.set_ghost(unmarshallGhost(th)); + m.set_ghost(unmarshallGhost(th, _tag_minor_version)); m.check_speed(); } @@ -2446,7 +2446,7 @@ static void marshallGhost(writer &th, const ghost_demon &ghost) marshallSpells(th, ghost.spells); } -static ghost_demon unmarshallGhost(reader &th) +static ghost_demon unmarshallGhost(reader &th, char minorVersion) { ghost_demon ghost; @@ -2454,7 +2454,10 @@ static ghost_demon unmarshallGhost(reader &th) ghost.species = static_cast<species_type>( unmarshallShort(th) ); ghost.job = static_cast<job_type>( unmarshallShort(th) ); - ghost.religion = static_cast<god_type>( unmarshallByte(th) ); + + if (minorVersion >= TAG_MINOR_RELIGION) + ghost.religion = static_cast<god_type>( unmarshallByte(th) ); + ghost.best_skill = static_cast<skill_type>( unmarshallShort(th) ); ghost.best_skill_level = unmarshallShort(th); ghost.xl = unmarshallShort(th); @@ -2494,5 +2497,5 @@ static void tag_read_ghost(reader &th, char minorVersion) return; for (int i = 0; i < nghosts; ++i) - ghosts.push_back(unmarshallGhost(th)); + ghosts.push_back(unmarshallGhost(th, minorVersion)); } |