diff options
author | Charles Otto <ottochar@gmail.com> | 2009-10-14 01:09:18 -0400 |
---|---|---|
committer | Charles Otto <ottochar@gmail.com> | 2009-10-14 01:10:08 -0400 |
commit | 42f60b21d0b8f1724419bf944f7893b91b0246f1 (patch) | |
tree | c6fb127e649185feda5b4cdd6d116540f461abb2 | |
parent | 27fdc593f2bca7c51edab41d2bf8dbc166ef2ac4 (diff) | |
download | crawl-ref-42f60b21d0b8f1724419bf944f7893b91b0246f1.tar.gz crawl-ref-42f60b21d0b8f1724419bf944f7893b91b0246f1.zip |
Prevent (glowing) shapeshifters from changing shape while taking the stairs, this takes care of bug [2864706].
-rw-r--r-- | crawl-ref/source/mon-util.cc | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc index bd9a49fe22..32fd1288a5 100644 --- a/crawl-ref/source/mon-util.cc +++ b/crawl-ref/source/mon-util.cc @@ -7739,13 +7739,18 @@ void monsters::apply_enchantment(const mon_enchant &me) case ENCH_GLOWING_SHAPESHIFTER: // This ench never runs out! // Number of actions is fine for shapeshifters. - if (type == MONS_GLOWING_SHAPESHIFTER || one_chance_in(4)) + // Don't change shape while taking the stairs because + // monster_polymorph has an assert about it -cao + if (!(this->flags & MF_TAKING_STAIRS) + && (type == MONS_GLOWING_SHAPESHIFTER + || one_chance_in(4))) monster_polymorph(this, RANDOM_MONSTER); break; case ENCH_SHAPESHIFTER: // This ench never runs out! - if (type == MONS_SHAPESHIFTER - || x_chance_in_y(1000 / (15 * hit_dice / 5), 1000)) + if (!(this->flags & MF_TAKING_STAIRS) + && (type == MONS_SHAPESHIFTER + || x_chance_in_y(1000 / (15 * hit_dice / 5), 1000))) { monster_polymorph(this, RANDOM_MONSTER); } |