diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-06 11:03:21 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-06 11:03:21 +0000 |
commit | 960323c5b08a5431ac60b72c7de65a40ef203183 (patch) | |
tree | 6571ec0d182fd5a597968a0415f80a15bbea3680 /crawl-ref/source/spl-cast.cc | |
parent | 6efc5c639a0ba48559c2fad77376a210b503256c (diff) | |
download | crawl-ref-960323c5b08a5431ac60b72c7de65a40ef203183.tar.gz crawl-ref-960323c5b08a5431ac60b72c7de65a40ef203183.zip |
Fix 1945389: Detect Creatures not clearing monsters detected on changed
terrain.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6419 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-cast.cc')
-rw-r--r-- | crawl-ref/source/spl-cast.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 0e552e784c..225018a140 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -2006,13 +2006,20 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail) case SPELL_DETECT_CREATURES: { - int known_plants = count_detected_plants(); - int num_creatures = detect_creatures(powc); + const int prev_detected = count_detected_mons(); + const int num_creatures = detect_creatures(powc); if (!num_creatures) mpr("You detect nothing."); - else if (num_creatures == known_plants) + else if (num_creatures == prev_detected) + { + // This is not strictly true. You could have cast + // Detect Creatures with a big enough fuzz that the detected + // glyph is still on the map when the original one has been + // killed. Then another one is spawned, so the number is + // the same as before. There's no way we can check this however. mpr("You detect no further creatures."); + } else mpr("You detect creatures!"); break; |