summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-17 21:23:24 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-17 21:23:24 +0000
commit83ac33ef8c9549bc43ded130f86b1341d93be393 (patch)
tree16d8c1de6e46a081c2b94bc132bd8310ee9c2ed3 /crawl-ref
parent0a8341f8e4674b2c08447a9435cb3e2bfa28edef (diff)
downloadcrawl-ref-83ac33ef8c9549bc43ded130f86b1341d93be393.tar.gz
crawl-ref-83ac33ef8c9549bc43ded130f86b1341d93be393.zip
For consistency with e.g. inadvertently attacking friends while
confused, don't give the "Really attack..." prompt when making an unchivalric attack under those circumstances either. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5113 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/fight.cc21
1 files changed, 10 insertions, 11 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 6bfc284e9f..26503befc7 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -2823,7 +2823,7 @@ int melee_attack::player_to_hit(bool random_factor)
void melee_attack::player_stab_check()
{
unchivalric_attack_type unchivalric =
- is_unchivalric_attack(attacker, defender, def);
+ is_unchivalric_attack(&you, defender, def);
bool roll_needed = true;
int roll = 155;
@@ -2874,18 +2874,17 @@ void melee_attack::player_stab_check()
if (unchivalric)
{
- bool cancel_stab =
- (you.religion == GOD_SHINING_ONE
- && !tso_unchivalric_attack_safe_monster(defender)
- && !yesno("Really attack this helpless creature?", false, 'n'));
-
- if (cancel_stab)
+ if (you.religion == GOD_SHINING_ONE
+ && !tso_unchivalric_attack_safe_monster(defender))
{
- stab_attempt = false;
- cancel_attack = true;
+ if (!you.confused()
+ && !yesno("Really attack this helpless creature?", false, 'n'))
+ {
+ cancel_attack = true;
+ }
+ else
+ did_god_conduct(DID_UNCHIVALRIC_ATTACK, 5, true, def);
}
- else
- did_god_conduct(DID_UNCHIVALRIC_ATTACK, 5, true, def);
}
}