diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-02 14:44:15 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-02 14:44:15 +0000 |
commit | 49401e18692e235ddd101c51073d93d96a33954e (patch) | |
tree | cb0b7ebf262dbef83021c6e0497407d47993373a /crawl-ref/source/directn.cc | |
parent | e37ab8471fcc8761a0d4a4954918ec4c679ed1bb (diff) | |
download | crawl-ref-49401e18692e235ddd101c51073d93d96a33954e.tar.gz crawl-ref-49401e18692e235ddd101c51073d93d96a33954e.zip |
Added allow_self_target option, with possible values yes, no, prompt.
Added brief documentation (could be improved.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6339 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/directn.cc')
-rw-r--r-- | crawl-ref/source/directn.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 02fd4582fc..6b7e417277 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -1044,14 +1044,17 @@ void direction(dist& moves, targeting_type restricts, // A bunch of confirmation tests; if we survive them all, // then break out. - // Confirm self-targeting on TARG_ENEMY. + // Confirm self-targeting on TARG_ENEMY (option-controlled.) // Conceivably we might want to confirm on TARG_ANY too. if (moves.isTarget && moves.tx == you.x_pos && moves.ty == you.y_pos && mode == TARG_ENEMY - && !yesno("Really target yourself?", false, 'n')) + && (Options.allow_self_target == CONFIRM_CANCEL + || (Options.allow_self_target == CONFIRM_PROMPT + && !yesno("Really target yourself?", false, 'n')))) { - mesclr(); + if (Options.allow_self_target == CONFIRM_CANCEL ) + mpr("That would be overly suicidal.", MSGCH_EXAMINE_FILTER); show_prompt = true; } else if ( moves.isTarget && !see_grid(moves.tx, moves.ty) ) |