diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2010-10-09 17:49:41 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2010-10-09 17:49:41 +1000 |
commit | 37ff07540b1bec6b0eba35d61e289bf1a2e7e8b1 (patch) | |
tree | 9f3f40630262fb6354d38bbde2814da072c93016 /crawl-ref/source/mapmark.cc | |
parent | 6db63e53ac18b1a1bf386982e5be0ff831346646 (diff) | |
download | crawl-ref-37ff07540b1bec6b0eba35d61e289bf1a2e7e8b1.tar.gz crawl-ref-37ff07540b1bec6b0eba35d61e289bf1a2e7e8b1.zip |
Make Malign Gateway a one-at-a-time spell.
This prevents multiple gateways from being opened by the player and
therefore multiple tentacles wreaking havoc upon one's enemies; the
current code means that, for example, if a monster opens a malign
gateway you won't be able to open one in retaliation.
Bumps minor version, hopefully in a safe manner.
Diffstat (limited to 'crawl-ref/source/mapmark.cc')
-rw-r--r-- | crawl-ref/source/mapmark.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/crawl-ref/source/mapmark.cc b/crawl-ref/source/mapmark.cc index b4ef8edcfd..b904a7a448 100644 --- a/crawl-ref/source/mapmark.cc +++ b/crawl-ref/source/mapmark.cc @@ -615,8 +615,8 @@ std::string map_tomb_marker::debug_describe() const map_malign_gateway_marker::map_malign_gateway_marker(const coord_def &p, int dur, bool ip, monster* mon, god_type gd, int pow) - : map_marker(MAT_MALIGN, p), duration(dur), is_player(ip), caster(mon), - god(gd), power(pow) + : map_marker(MAT_MALIGN, p), duration(dur), is_player(ip), monster_summoned(false), + caster(mon), god(gd), power(pow) { } @@ -625,6 +625,7 @@ void map_malign_gateway_marker::write(writer &out) const map_marker::write(out); marshallShort(out, duration); marshallBoolean(out, is_player); + marshallBoolean(out, monster_summoned); if (!is_player) marshallMonster(out, *caster); marshallByte(out, god); @@ -636,6 +637,17 @@ void map_malign_gateway_marker::read(reader &in) map_marker::read(in); duration = unmarshallShort(in); is_player = unmarshallBoolean(in); + +#if TAG_MAJOR_VERSION == 31 + int minorVersion = in.getMinorVersion(); + if (minorVersion < TAG_MINOR_MALIGN) + monster_summoned = unmarshallBoolean(in); + else + monster_summoned = true; +#else + monster_summoned = unmarshallBoolean(in); +#endif + if (!is_player) unmarshallMonster(in, *caster); else |