summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-clone.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2011-12-29 16:16:46 -0500
committerNeil Moore <neil@s-z.org>2011-12-29 17:45:32 -0500
commit8111c562c01bcdd7e9603d07690f47180b07ac6f (patch)
tree6ac65639a562c4b290a08b9c1c77ee95450821e2 /crawl-ref/source/mon-clone.cc
parent998156aa3cec4574877cf4b28faaf49a41a95091 (diff)
downloadcrawl-ref-8111c562c01bcdd7e9603d07690f47180b07ac6f.tar.gz
crawl-ref-8111c562c01bcdd7e9603d07690f47180b07ac6f.zip
Refactor constriction clearing, fix dead constrictions.
Split clear_specific_constrictions() into stop_contricting() and stop_being_constricted() (and clear_all_constrictions() into stop_constricting_all() and stop_being_constricted()). Also, better distinguish between intentional and accidental loss of constriction (for messaging purposes). Try much harder to keep the constrictor's and constrictee's data in sync. This fixes a bug where you could still be constricting DEAD_MONSTER even though all its constrictions were cleared when it died. Finally, clear constrictions when changing levels (e.g. banishment).
Diffstat (limited to 'crawl-ref/source/mon-clone.cc')
-rw-r--r--crawl-ref/source/mon-clone.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/crawl-ref/source/mon-clone.cc b/crawl-ref/source/mon-clone.cc
index c137a15f41..babba49262 100644
--- a/crawl-ref/source/mon-clone.cc
+++ b/crawl-ref/source/mon-clone.cc
@@ -304,7 +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();
+ // The monster copy constructor doesn't copy constriction, so no need to
+ // worry about that.
mgrd(pos) = mons->mindex();