diff options
author | Charles Otto <ottochar@gmail.com> | 2009-11-15 12:56:28 -0500 |
---|---|---|
committer | Charles Otto <ottochar@gmail.com> | 2009-11-15 12:56:28 -0500 |
commit | 26c3b08c11c3e1d2eb073bba72d802f205b351b4 (patch) | |
tree | 622ae638060610625f49a0e8907e3e92ea957a3e /crawl-ref/source/monster.cc | |
parent | df14ad5de0f71c63dfeca5594e117be125f5d137 (diff) | |
download | crawl-ref-26c3b08c11c3e1d2eb073bba72d802f205b351b4.tar.gz crawl-ref-26c3b08c11c3e1d2eb073bba72d802f205b351b4.zip |
Fix spore production always getting re-added (oops)
Fix a logical error preventing spore production from ever getting
removed from a ballistomycete.
Diffstat (limited to 'crawl-ref/source/monster.cc')
-rw-r--r-- | crawl-ref/source/monster.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index 8f8df5b8b0..fa93d0a800 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -4980,6 +4980,8 @@ void monsters::apply_enchantment(const mon_enchant &me) int idx[] = {0, 1, 2, 3, 4, 5, 6, 7}; std::random_shuffle(idx, idx + 8); + bool re_add = true; + for (unsigned i = 0; i < 8; ++i) { coord_def adjacent = this->pos() + Compass[idx[i]]; @@ -5015,6 +5017,7 @@ void monsters::apply_enchantment(const mon_enchant &me) { this->colour = MAGENTA; this->del_ench(ENCH_SPORE_PRODUCTION); + re_add = false; } } @@ -5024,7 +5027,8 @@ void monsters::apply_enchantment(const mon_enchant &me) } // Re-add the enchantment (this resets the spore production // timer). - this->add_ench(ENCH_SPORE_PRODUCTION); + if (re_add) + this->add_ench(ENCH_SPORE_PRODUCTION); } break; |