From 5006c1e3f3d193c18cd2bf76a50163fbab1b8052 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 13 Jul 2008 19:38:46 +0000 Subject: Fix 2017251: The annotation prompt not escaping properly. Fix 2016627: Ranged weapons of protection autoIDing when wielded by monsters. Fix the double prompt when using Ctrl-P in the quivering interface (part of BR 2017260), fix targetting via monster list to be turned off if there are no monsters in sight, and map auto-travel to both G and Ctrl-G. (The monster list command moves to V.) Again, I'm not sure I got all the relevant documentation. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6529 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/directn.cc | 27 ++++++++++++++++++++------- 1 file changed, 20 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 ba9bf9fe5c..746ac18bb3 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -474,10 +474,11 @@ void direction(dist& moves, targeting_type restricts, bool needs_path, bool may_target_monster, const char *prompt, targeting_behaviour *beh, bool cancel_at_self) { - static targeting_behaviour stock_behaviour; if (!beh) + { + static targeting_behaviour stock_behaviour; beh = &stock_behaviour; - + } beh->just_looking = just_looking; #ifndef USE_TILE @@ -485,8 +486,16 @@ void direction(dist& moves, targeting_type restricts, && Options.mlist_targetting == MLIST_TARGET_HIDDEN) { Options.mlist_targetting = MLIST_TARGET_ON; - bool full_info = update_monster_pane(); - _fill_monster_list(full_info); + + const int full_info = update_monster_pane(); + if (full_info == -1) + { + // If there are no monsters after all, turn the the targetting + // off again. + Options.mlist_targetting = MLIST_TARGET_HIDDEN; + } + else + _fill_monster_list(full_info); } #endif @@ -735,10 +744,14 @@ void direction(dist& moves, targeting_type restricts, else Options.mlist_targetting = MLIST_TARGET_ON; - bool full_info = update_monster_pane(); - + const int full_info = update_monster_pane(); if (Options.mlist_targetting == MLIST_TARGET_ON) - _fill_monster_list(full_info); + { + if (full_info == -1) + Options.mlist_targetting = MLIST_TARGET_HIDDEN; + else + _fill_monster_list(full_info); + } break; } #endif -- cgit v1.2.3-54-g00ecf