summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/direct.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-15 03:54:11 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-05-15 03:54:11 +0000
commit0cb9011c4d8b1075d0459007641cb2cd7fa94907 (patch)
tree6e5629a8275ff61aa1e8881c419817dab39a9b40 /crawl-ref/source/direct.cc
parent542cf75b89614ad8859fd345230fbd124316a48d (diff)
downloadcrawl-ref-0cb9011c4d8b1075d0459007641cb2cd7fa94907.tar.gz
crawl-ref-0cb9011c4d8b1075d0459007641cb2cd7fa94907.zip
1718585: 'f' and 't' behaviour changed, as follows:
If cursor is on you, 'f' and 't' act like 'p' (fire at previous target.) Otherwise they act like '.' (fire at current target.) 'p' is still unconditional fire-at-previous-target. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1473 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/direct.cc')
-rw-r--r--crawl-ref/source/direct.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/crawl-ref/source/direct.cc b/crawl-ref/source/direct.cc
index c43c89ab6b..d851b4d504 100644
--- a/crawl-ref/source/direct.cc
+++ b/crawl-ref/source/direct.cc
@@ -133,7 +133,8 @@ static command_type read_direction_key(bool just_looking = false)
case '>': return CMD_TARGET_FIND_DOWNSTAIR;
case CONTROL('F'): return CMD_TARGET_CYCLE_TARGET_MODE;
- case 'p': case 'f': case 't': return CMD_TARGET_PREV_TARGET;
+ case 'p': return CMD_TARGET_PREV_TARGET;
+ case 'f': case 't': return CMD_TARGET_MAYBE_PREV_TARGET;
case '-': return CMD_TARGET_CYCLE_BACK;
case '+': case '=': return CMD_TARGET_CYCLE_FORWARD;
@@ -386,6 +387,14 @@ void direction(struct dist& moves, targeting_type restricts,
target_unshifted = false;
}
+ if ( key_command == CMD_TARGET_MAYBE_PREV_TARGET )
+ {
+ if ( moves.tx == you.x_pos && moves.ty == you.y_pos )
+ key_command = CMD_TARGET_PREV_TARGET;
+ else
+ key_command = CMD_TARGET_SELECT;
+ }
+
bool need_beam_redraw = false;
bool force_redraw = false;
bool loop_done = false;