summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-05 13:33:29 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-05 13:33:29 +0000
commitff2f267821153758bcd691e73b1b409c62f0c4e0 (patch)
tree11f18df98aad81ddfa9798dafd67eceb3b4ed510 /crawl-ref/source/tags.cc
parent3423bbab5a0f024eeafffe6b8260c8c088647db1 (diff)
downloadcrawl-ref-ff2f267821153758bcd691e73b1b409c62f0c4e0.tar.gz
crawl-ref-ff2f267821153758bcd691e73b1b409c62f0c4e0.zip
Cleaned up monster generation functions, separate monster zombie type from monster number. May be buggy.
Allow hydra zombies (they currently do not get the right number of heads). git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4872 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 92b4c994ee..4a3f586a66 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1784,6 +1784,7 @@ static void marshall_monster(writer &th, const monsters &m)
marshallShort(th, m.hit_points);
marshallShort(th, m.max_hit_points);
marshallShort(th, m.number);
+ marshallShort(th, m.base_monster);
marshallShort(th, m.colour);
for (int j = 0; j < NUM_MONSTER_SLOTS; j++)
@@ -2047,6 +2048,10 @@ static void unmarshall_monster(reader &th, monsters &m)
m.hit_points = unmarshallShort(th);
m.max_hit_points = unmarshallShort(th);
m.number = unmarshallShort(th);
+ if (_tag_minor_version >= TAG_MINOR_MONBASE)
+ m.base_monster = static_cast<monster_type>(unmarshallShort(th));
+ else
+ m.base_monster = static_cast<monster_type>(m.number);
m.colour = unmarshallShort(th);
@@ -2071,7 +2076,7 @@ static void tag_read_level_monsters(reader &th, char minorVersion)
// how many mons_alloc?
count = unmarshallByte(th);
for (i = 0; i < count; ++i)
- env.mons_alloc[i] = unmarshallShort(th);
+ env.mons_alloc[i] = static_cast<monster_type>( unmarshallShort(th) );
// how many monsters?
count = unmarshallShort(th);