summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-03 21:48:04 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-03 21:48:04 +0000
commitd0e164c2124ff90bca9eef4b06f9d2f0a9006964 (patch)
treebd53285d6ddd31e8073fdff22ece975e5e51e426 /crawl-ref/source/directn.cc
parent189cd2fc2491bde8c2efa508d808c67700b38b8d (diff)
downloadcrawl-ref-d0e164c2124ff90bca9eef4b06f9d2f0a9006964.tar.gz
crawl-ref-d0e164c2124ff90bca9eef4b06f9d2f0a9006964.zip
[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
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc15
1 files changed, 8 insertions, 7 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 )