summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-clone.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2011-12-28 17:59:44 -0500
committerNeil Moore <neil@s-z.org>2011-12-28 18:16:08 -0500
commit7657a9ca8becfad1e17f32f66bfe7656340d4499 (patch)
tree257e83a52289f46ae983c07b824000018c42ce8c /crawl-ref/source/mon-clone.cc
parente270302f761bd8bd16b92757e74bfb190c4c2a95 (diff)
downloadcrawl-ref-7657a9ca8becfad1e17f32f66bfe7656340d4499.tar.gz
crawl-ref-7657a9ca8becfad1e17f32f66bfe7656340d4499.zip
Fix constriction crash on monster swapping etc.
There were some ways to be moved that didn't involve a call to moveto(). Clear nonadjacent constrictions in those cases (and in the case of monster cloning).
Diffstat (limited to 'crawl-ref/source/mon-clone.cc')
-rw-r--r--crawl-ref/source/mon-clone.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-clone.cc b/crawl-ref/source/mon-clone.cc
index 1d17acdd99..c137a15f41 100644
--- a/crawl-ref/source/mon-clone.cc
+++ b/crawl-ref/source/mon-clone.cc
@@ -304,6 +304,8 @@ int clone_mons(const monster* orig, bool quiet, bool* obvious,
*mons = *orig;
mons->set_new_monster_id();
mons->set_position(pos);
+ mons->clear_all_constrictions();
+
mgrd(pos) = mons->mindex();
// Duplicate objects, or unequip them if they can't be duplicated.