summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monster.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-11-15 12:56:28 -0500
committerCharles Otto <ottochar@gmail.com>2009-11-15 12:56:28 -0500
commit26c3b08c11c3e1d2eb073bba72d802f205b351b4 (patch)
tree622ae638060610625f49a0e8907e3e92ea957a3e /crawl-ref/source/monster.cc
parentdf14ad5de0f71c63dfeca5594e117be125f5d137 (diff)
downloadcrawl-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.cc6
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;