summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.cc
diff options
context:
space:
mode:
authorNicholas Feinberg <pleasingfung@gmail.com>2014-07-13 15:38:23 -0700
committerNicholas Feinberg <pleasingfung@gmail.com>2014-07-13 17:19:02 -0700
commitd22ebac678fa1c1d0a60048a72ba445e3ed190d1 (patch)
treea63ccd59b4bb01408be9fc5843c20f2f878e2cd2 /crawl-ref/source/tags.cc
parent5562ea36cc1ba917da155a9dd93e6bf71d022771 (diff)
downloadcrawl-ref-d22ebac678fa1c1d0a60048a72ba445e3ed190d1.tar.gz
crawl-ref-d22ebac678fa1c1d0a60048a72ba445e3ed190d1.zip
Separate 'permanent' and 'temporary' monster hit dice
As part of a wider scheme to make draining temporary.
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 8695640fcd..dec1eb6a90 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -4134,7 +4134,7 @@ void marshallMonster(writer &th, const monster& m)
marshallString(th, m.mname);
marshallByte(th, m.ac);
marshallByte(th, m.ev);
- marshallByte(th, m.hit_dice);
+ marshallByte(th, m.get_experience_level());
marshallByte(th, m.speed);
marshallByte(th, m.speed_increment);
marshallByte(th, m.behaviour);
@@ -4865,13 +4865,13 @@ void unmarshallMonster(reader &th, monster& m)
m.mname = unmarshallString(th);
m.ac = unmarshallByte(th);
m.ev = unmarshallByte(th);
- m.hit_dice = unmarshallByte(th);
+ m.set_hit_dice( unmarshallByte(th));
#if TAG_MAJOR_VERSION == 34
// Draining used to be able to take a monster to 0 HD, but that
// caused crashes if they tried to cast spells.
- m.hit_dice = max(m.hit_dice, 1);
+ m.set_hit_dice(max(m.get_experience_level(), 1));
#else
- ASSERT(m.hit_dice > 0);
+ ASSERT(m.get_experience_level() > 0);
#endif
m.speed = unmarshallByte(th);
// Avoid sign extension when loading files (Elethiomel's hang)