From 960323c5b08a5431ac60b72c7de65a40ef203183 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 6 Jul 2008 11:03:21 +0000 Subject: 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 --- crawl-ref/source/spl-cast.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'crawl-ref/source/spl-cast.cc') 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; -- cgit v1.2.3-54-g00ecf