summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-stuff.cc
diff options
context:
space:
mode:
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;