summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2014-02-04 20:09:37 -0500
committerNeil Moore <neil@s-z.org>2014-02-04 20:15:45 -0500
commit5aee7720d2cc0247a8b1a9503eb748468551d51c (patch)
tree60385ddb62c1246ae8e00f1855a1c77c486216b6 /crawl-ref/source/directn.cc
parentffe09b40666d9524815675f0e6f6308b28acbfb9 (diff)
downloadcrawl-ref-5aee7720d2cc0247a8b1a9503eb748468551d51c.tar.gz
crawl-ref-5aee7720d2cc0247a8b1a9503eb748468551d51c.zip
Don't crash when cycling features near the map edge with LRD.
See for example: http://crawl.akrasiac.org/rawdata/hustleandflow/crash-hustleandflow-20140205-004513.txt To reproduce: memorise LRD, go near the edge of the map away from any portals, start to cast LRD and press <Tab> in the targetter. It doesn't seem to happen with other spells, even Conjure Flame.
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index 4fc9815c94..651e9740b9 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -2513,6 +2513,9 @@ static bool _find_monster_expl(const coord_def& where, int mode, bool need_path,
static bool _find_feature(const coord_def& where, int mode,
bool /* need_path */, int /* range */, targetter*)
{
+ if (!map_bounds(where))
+ return false;
+
// The stair need not be in LOS if the square is mapped.
if (!you.see_cell(where) && !env.map_knowledge(where).seen())
return false;