diff options
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/directn.cc | 15 | ||||
-rw-r--r-- | crawl-ref/source/tilereg.cc | 2 |
2 files changed, 9 insertions, 8 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index dc6237f459..eff91c6489 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -131,11 +131,6 @@ void direction_choose_compass( dist& moves, targeting_behaviour *beh) beh->compass = true; -#ifdef USE_TILE - // Force update of mouse cursor to direction-compatible location. - tiles.place_cursor(CURSOR_MOUSE, tiles.get_cursor()); -#endif - do { const command_type key_command = beh->get_command(); @@ -155,8 +150,10 @@ void direction_choose_compass( dist& moves, targeting_behaviour *beh) if (delta.x < -1 || delta.x > 1 || delta.y < -1 || delta.y > 1) { - // This shouldn't happen. - continue; + tiles.place_cursor(CURSOR_MOUSE, gc); + delta = tiles.get_cursor() - you.pos(); + ASSERT(delta.x >= -1 && delta.x <= 1); + ASSERT(delta.y >= -1 && delta.y <= 1); } moves.delta = delta; @@ -184,6 +181,10 @@ void direction_choose_compass( dist& moves, targeting_behaviour *beh) } } while (!moves.isCancel && moves.delta.origin()); + +#ifdef USE_TILE + tiles.place_cursor(CURSOR_MOUSE, Region::NO_CURSOR); +#endif } static int _targeting_cmd_to_compass( command_type command ) diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index ee97fc6089..e3ed46d1ba 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -972,7 +972,7 @@ void DungeonRegion::place_cursor(cursor_type type, const coord_def &gc) // cursor next to the player to let them know that their // spell/wand will only go one square. if (mouse_control::current_mode() == MOUSE_MODE_TARGET_DIR - && type == CURSOR_MOUSE) + && type == CURSOR_MOUSE && gc != NO_CURSOR) { coord_def delta = gc - you.pos(); |