summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-20 14:19:42 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-20 14:19:42 +0000
commit1db426b1b8d3fcfa2122dee47290597bcd63ee91 (patch)
tree360ef66174eed525363b0b5b07a59d9ba2be2831 /crawl-ref/source/tags.cc
parent913179f028b4a254eb5034ef6ce945d07ac5925a (diff)
downloadcrawl-ref-1db426b1b8d3fcfa2122dee47290597bcd63ee91.tar.gz
crawl-ref-1db426b1b8d3fcfa2122dee47290597bcd63ee91.zip
Add monster-specific rotting resistance.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10740 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 4d133247f1..c60de53eec 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -190,8 +190,9 @@ static void tag_read_ghost(reader &th, char minorVersion);
static void marshallGhost(writer &th, const ghost_demon &ghost);
static ghost_demon unmarshallGhost(reader &th, char minorVersion);
-static void marshallResists(writer &, const mon_resist_def &);
-static void unmarshallResists(reader &, mon_resist_def &);
+static void marshallResists(writer &th, const mon_resist_def &res);
+static void unmarshallResists(reader &th, mon_resist_def &res,
+ char minorVersion);
static void marshallSpells(writer &, const monster_spells &);
static void unmarshallSpells(reader &, monster_spells &);
@@ -2403,12 +2404,14 @@ static void marshallResists(writer &th, const mon_resist_def &res)
marshallByte(th, res.asphyx);
marshallByte(th, res.acid);
marshallByte(th, res.sticky_flame);
+ marshallByte(th, res.rotting);
marshallByte(th, res.pierce);
marshallByte(th, res.slice);
marshallByte(th, res.bludgeon);
}
-static void unmarshallResists(reader &th, mon_resist_def &res)
+static void unmarshallResists(reader &th, mon_resist_def &res,
+ char minorVersion)
{
res.elec = unmarshallByte(th);
res.poison = unmarshallByte(th);
@@ -2419,6 +2422,10 @@ static void unmarshallResists(reader &th, mon_resist_def &res)
res.asphyx = unmarshallByte(th);
res.acid = unmarshallByte(th);
res.sticky_flame = unmarshallByte(th);
+
+ if (minorVersion >= TAG_MINOR_ROTTING)
+ res.rotting = unmarshallByte(th);
+
res.pierce = unmarshallByte(th);
res.slice = unmarshallByte(th);
res.bludgeon = unmarshallByte(th);
@@ -2495,7 +2502,7 @@ static ghost_demon unmarshallGhost(reader &th, char minorVersion)
ghost.att_flav = static_cast<mon_attack_flavour>( unmarshallShort(th) );
}
- unmarshallResists(th, ghost.resists);
+ unmarshallResists(th, ghost.resists, minorVersion);
ghost.spellcaster = unmarshallByte(th);
ghost.cycle_colours = unmarshallByte(th);