summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/teleport.cc
diff options
context:
space:
mode:
authorRaphael Langella <raphael.langella@gmail.com>2012-02-28 16:45:09 +0100
committerRaphael Langella <raphael.langella@gmail.com>2012-02-28 16:45:09 +0100
commitcb4b11c835793ce8c0be024c32e6a53e177d60c5 (patch)
tree7c2d7f1e7d162c88128be866570c8046b14f552c /crawl-ref/source/teleport.cc
parent20f5c9dfeb90926582f883df1e35e21c8616015b (diff)
downloadcrawl-ref-cb4b11c835793ce8c0be024c32e6a53e177d60c5.tar.gz
crawl-ref-cb4b11c835793ce8c0be024c32e6a53e177d60c5.zip
Make fleeing monster blink_away when reading the scroll.
Instead of doing a random blink.
Diffstat (limited to 'crawl-ref/source/teleport.cc')
-rw-r--r--crawl-ref/source/teleport.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/crawl-ref/source/teleport.cc b/crawl-ref/source/teleport.cc
index 8f794e96a2..1e61de7db4 100644
--- a/crawl-ref/source/teleport.cc
+++ b/crawl-ref/source/teleport.cc
@@ -134,19 +134,17 @@ void blink_other_close(actor* victim, const coord_def &target)
}
// Blink the monster away from its foe.
-void blink_away(monster* mon)
+bool blink_away(monster* mon)
{
actor* foe = mon->get_foe();
if (!foe || !mon->can_see(foe))
- return;
+ return false;
coord_def dest = random_space_weighted(mon, foe, false, false);
if (dest.origin())
- return;
+ return false;
bool success = mon->blink_to(dest);
ASSERT(success);
-#ifndef DEBUG
- UNUSED(success);
-#endif
+ return success;
}
// Blink the monster within range but at distance to its foe.