summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index c49d39b800..1106bbf47b 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2085,6 +2085,7 @@ bool monster_polymorph(monsters *monster, monster_type targetc,
ENCH_SHAPESHIFTER);
mon_enchant summon = monster->get_ench(ENCH_SUMMON);
mon_enchant tp = monster->get_ench(ENCH_TP);
+ monster_spells spl = monster->spells;
// deal with mons_sec
monster->type = targetc;
@@ -2098,6 +2099,10 @@ bool monster_polymorph(monsters *monster, monster_type targetc,
monster->flags = flags;
monster->god = god;
+ // Keep spells for named monsters.
+ if (!name.empty())
+ monster->spells = spl;
+
monster->add_ench(abj);
monster->add_ench(charm);
monster->add_ench(neutral);