From a880ee8e1cce98a582a438bb19fd5e85ea8d0a52 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Thu, 12 Nov 2009 17:31:17 -0800 Subject: 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. --- crawl-ref/source/mon-stuff.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/mon-stuff.cc') 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 -- cgit v1.2.3-54-g00ecf