summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-stuff.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-14 22:34:41 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-15 01:20:33 -0800
commit497913340c6d5ba0c22174b94334e5be07801e79 (patch)
tree609f032da15bf8c6535b3624b45ece76265e6f69 /crawl-ref/source/mon-stuff.cc
parent6cda5fe31dffd0c018008e0e5d8921f9c0cc8a43 (diff)
downloadcrawl-ref-497913340c6d5ba0c22174b94334e5be07801e79.tar.gz
crawl-ref-497913340c6d5ba0c22174b94334e5be07801e79.zip
mon-stuff.cc: de-porkalator bug fixes
* Define a new monster for hogs that came with Kirke turning to humans. * Keep reverted monsters at same location.
Diffstat (limited to 'crawl-ref/source/mon-stuff.cc')
-rw-r--r--crawl-ref/source/mon-stuff.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc
index 0e0ae3489a..67690b0a84 100644
--- a/crawl-ref/source/mon-stuff.cc
+++ b/crawl-ref/source/mon-stuff.cc
@@ -1205,24 +1205,27 @@ static void _hogs_to_humans()
}
else
{
- orig = &_orig;
+ orig = &_orig;
+
orig->type = MONS_HUMAN;
define_monster(*orig);
}
+ // Keep at same spot.
+ const coord_def pos = mi->pos();
// Preserve relative HP.
const float hp
= (float) mi->hit_points / (float) mi->max_hit_points;
// Preserve some flags.
const unsigned long preserve_flags =
mi->flags & ~(MF_JUST_SUMMONED | MF_WAS_IN_VIEW);
-
// Preserve enchantments.
mon_enchant_list enchantments = mi->enchantments;
// Restore original monster.
**mi = *orig;
+ mi->set_position(pos);
mi->enchantments = enchantments;
mi->hit_points = std::max(1, (int) (mi->max_hit_points * hp));
mi->flags = mi->flags | preserve_flags;