summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dactions.cc
diff options
context:
space:
mode:
authorEduardo Gonzalez <ed.gonzalez3@gmail.com>2014-04-29 23:45:57 -0700
committerShmuale Mark <shm.mark@gmail.com>2014-05-04 02:59:35 -0400
commit90ae437c9b4a4ec131d75d9dfd3060fb56b40978 (patch)
tree352ba36248e7965c8804f39fff8fb22eff01a4e3 /crawl-ref/source/dactions.cc
parent9c81f37786b5cf086cfd98148550d2f599385c9a (diff)
downloadcrawl-ref-90ae437c9b4a4ec131d75d9dfd3060fb56b40978.tar.gz
crawl-ref-90ae437c9b4a4ec131d75d9dfd3060fb56b40978.zip
Fix enchantments on hogs during Kirke death (#8446)
The enchantment list was being preserved, but not the cache of which ones were active. Reloading the game would succesfully reset the cache.
Diffstat (limited to 'crawl-ref/source/dactions.cc')
-rw-r--r--crawl-ref/source/dactions.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/dactions.cc b/crawl-ref/source/dactions.cc
index 426a5037f7..774a609362 100644
--- a/crawl-ref/source/dactions.cc
+++ b/crawl-ref/source/dactions.cc
@@ -334,6 +334,7 @@ static void _daction_hog_to_human(monster *mon, bool in_transit)
mon->flags & ~(MF_JUST_SUMMONED | MF_WAS_IN_VIEW);
// Preserve enchantments.
mon_enchant_list enchantments = mon->enchantments;
+ FixedBitVector<NUM_ENCHANTMENTS> ench_cache = mon->ench_cache;
// Restore original monster.
*mon = orig;
@@ -349,6 +350,7 @@ static void _daction_hog_to_human(monster *mon, bool in_transit)
// "else {mon->position = pos}" is unnecessary because the transit code will
// ignore the old position anyway.
mon->enchantments = enchantments;
+ mon->ench_cache = ench_cache;
mon->hit_points = max(1, (int) (mon->max_hit_points * hp));
mon->flags = mon->flags | preserve_flags;