From 30972f8855a581f440406e7bc5880f18a489efb4 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 28 Jul 2008 11:26:54 +0000 Subject: Fix 2021696: allow_self_target = no even forbidding self-targetting for area effect spells (now prompts) Fix 2028704: spell view toggle 'I' preventing forgetting spell slot 'I' Allow intelligent summoned monsters to equip themselves. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6703 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/directn.cc | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/directn.cc') diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 287045cdeb..8d62b42c81 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -519,7 +519,8 @@ static int _mlist_letter_to_index(char idx) void direction(dist& moves, targeting_type restricts, targ_mode_type mode, int range, bool just_looking, - bool needs_path, bool may_target_monster, const char *prompt, + bool needs_path, bool may_target_monster, + bool may_target_self, const char *prompt, targeting_behaviour *beh, bool cancel_at_self) { if (!beh) @@ -1112,13 +1113,19 @@ void direction(dist& moves, targeting_type restricts, && mode == TARG_ENEMY && (cancel_at_self || Options.allow_self_target == CONFIRM_CANCEL - || Options.allow_self_target == CONFIRM_PROMPT - && !yesno("Really target yourself?", false, 'n'))) + && !may_target_self + || (Options.allow_self_target == CONFIRM_PROMPT + || Options.allow_self_target == CONFIRM_CANCEL + && may_target_self) + && !yesno("Really target yourself?", false, 'n'))) { if (cancel_at_self) mpr("Sorry, you can't target yourself."); - else if (Options.allow_self_target == CONFIRM_CANCEL) + else if (Options.allow_self_target == CONFIRM_CANCEL + && !may_target_self) + { mpr("That would be overly suicidal.", MSGCH_EXAMINE_FILTER); + } show_prompt = true; } @@ -1243,7 +1250,7 @@ std::string get_terse_square_desc(const coord_def &gc) } else if (!see_grid(gc)) { - if (is_terrain_seen(gc)) + if (is_terrain_seen(gc)) { desc = feature_description(gc, false, DESC_PLAIN, false); if (!see_grid(gc)) -- cgit v1.2.3-54-g00ecf