From da81aa1f63c426cd5d5fc04aa639aacaff0e5262 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Wed, 27 May 2009 04:38:33 +0000 Subject: Bug 2792673: when attempting auto-targeting, if the only monsters in LOS have the line-of-firing to them blocked by a wall then auto-targetting won't happen and the cursor/cross-hair will remain on the player. Give a message in such circumstances so the player will know why the monster wasn't auto-targetted. (Might also want to give the same message when doing "target cycle forward" in examination mode) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9837 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/directn.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/directn.cc') diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index e68d8e3f9e..9cccc435a1 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -1434,7 +1434,21 @@ void direction(dist& moves, targeting_type restricts, { moves.target = monsfind_pos; } - else if (!skip_iter) + else if (skip_iter) + { + if (needs_path && !just_looking + && _find_square_wrapper(moves.target, monsfind_pos, dir, + _find_monster, false, mode, + range, Options.target_wrap)) + { + mpr("All monsters which could be auto-targeted " + "are covered by a wall or statue which interrupts " + "your line of fire, even though it doesn't " + "interrupt your line of sight.", + MSGCH_PROMPT); + } + } + else flush_input_buffer(FLUSH_ON_FAILURE); break; -- cgit v1.2.3-54-g00ecf