From 497913340c6d5ba0c22174b94334e5be07801e79 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Sat, 14 Nov 2009 22:34:41 -0800 Subject: 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. --- crawl-ref/source/mon-stuff.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (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 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; -- cgit v1.2.3-54-g00ecf