diff options
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r-- | crawl-ref/source/directn.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index cc6b8ea9d7..5f6aa57fc9 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -149,6 +149,9 @@ void direction_choose_compass( dist& moves, targeting_behaviour *beh) if (gc == Region::NO_CURSOR) continue; + if (!map_bounds(gc)) + continue; + coord_def delta = gc - you.pos(); if (delta.x < -1 || delta.x > 1 || delta.y < -1 || delta.y > 1) @@ -160,7 +163,7 @@ void direction_choose_compass( dist& moves, targeting_behaviour *beh) } moves.delta = delta; - moves.isMe = delta.origin(); + moves.isMe = delta.origin(); break; } #endif @@ -1113,6 +1116,9 @@ void direction(dist& moves, targeting_type restricts, const coord_def &gc = tiles.get_cursor(); if (gc != Region::NO_CURSOR) { + if (!map_bounds(gc)) + continue; + moves.target = gc; if (key_command == CMD_TARGET_MOUSE_SELECT) |