diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-14 22:34:41 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-15 01:20:33 -0800 |
commit | 497913340c6d5ba0c22174b94334e5be07801e79 (patch) | |
tree | 609f032da15bf8c6535b3624b45ece76265e6f69 /crawl-ref/source/mon-stuff.cc | |
parent | 6cda5fe31dffd0c018008e0e5d8921f9c0cc8a43 (diff) | |
download | crawl-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.cc | 7 |
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; |