From d0e164c2124ff90bca9eef4b06f9d2f0a9006964 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Sat, 3 Jan 2009 21:48:04 +0000 Subject: [1904556] Fixing duplicate cursor during teleport/blink [2429406] Fixing targeting cursor appearing even if mouse hasn't moved. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8182 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/directn.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'crawl-ref/source/directn.cc') 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 ) -- cgit v1.2.3-54-g00ecf