summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/directn.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r--crawl-ref/source/directn.cc17
1 files changed, 12 insertions, 5 deletions
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))