summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-stuff.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-12 17:31:17 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-12 18:32:09 -0800
commita880ee8e1cce98a582a438bb19fd5e85ea8d0a52 (patch)
tree98223dbf23ef76b9e3014d11ec7444bbf729a2da /crawl-ref/source/mon-stuff.cc
parent3c1420d0049511a857ff147b6eefdf78b0e1fd0e (diff)
downloadcrawl-ref-a880ee8e1cce98a582a438bb19fd5e85ea8d0a52.tar.gz
crawl-ref-a880ee8e1cce98a582a438bb19fd5e85ea8d0a52.zip
mon-stuff.cc: de-porkulator: bugfix, improvements
Fix bug where all monsters were being "reverted" to their original form, not just hogs. Shapeshifters don't revert from hog form when Kirke dies. Preserve a monster's enchantments when it reverts from hog form.
Diffstat (limited to 'crawl-ref/source/mon-stuff.cc')
-rw-r--r--crawl-ref/source/mon-stuff.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc
index 09da57c214..d035182376 100644
--- a/crawl-ref/source/mon-stuff.cc
+++ b/crawl-ref/source/mon-stuff.cc
@@ -1311,7 +1311,11 @@ static void _hogs_to_humans()
for (monster_iterator mi; mi; ++mi)
{
- if (!mi->type == MONS_HOG)
+ if (mi->type != MONS_HOG)
+ continue;
+
+ // Shapeshifters will stop being a hog when they feel like it.
+ if (mi->is_shapeshifter())
continue;
const bool could_see = you.can_see(*mi);
@@ -1326,9 +1330,14 @@ static void _hogs_to_humans()
else
mi->type = (monster_type) (mi->number - 1);
+ // Keep enchantments.
+ mon_enchant_list enchantments = mi->enchantments;
+
mi->number = 0;
define_monster(**mi);
+ mi->enchantments = enchantments;
+
const bool can_see = you.can_see(*mi);
// A monster changing factions while in the arena messes up