summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-17 18:28:56 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-05-17 18:28:56 +0000
commit8af40b84cbc2dec50a2a2244aca9d01344614b6a (patch)
treebbf3fcc47aa77e283410133c4d338ab46fe345e7
parent51a3d79045ff49839e884b92c78e9a0cc01ed33f (diff)
downloadcrawl-ref-8af40b84cbc2dec50a2a2244aca9d01344614b6a.tar.gz
crawl-ref-8af40b84cbc2dec50a2a2244aca9d01344614b6a.zip
Fix handling of monsters that TSO doesn't mind your using unchivalric
attacks on. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5102 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/fight.cc9
-rw-r--r--crawl-ref/source/religion.cc4
2 files changed, 7 insertions, 6 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 3e4350ee6e..3db36c9e9a 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -2870,12 +2870,11 @@ void melee_attack::player_stab_check()
if (stab_attempt && roll_needed)
stab_attempt = (random2(roll) <= you.skills[SK_STABBING] + you.dex);
- if (unchivalric && you.religion == GOD_SHINING_ONE)
+ if (unchivalric)
{
- // check for the would-be-stabbed monster's being alive, in case
- // it was abjured as a result of the attack
- bool cancel_stab = !defender->alive() ||
- (!tso_unchivalric_attack_safe_monster(defender)
+ 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)
diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc
index 77a52bdc69..b3b106ab1c 100644
--- a/crawl-ref/source/religion.cc
+++ b/crawl-ref/source/religion.cc
@@ -1895,7 +1895,9 @@ bool did_god_conduct( conduct_type thing_done, int level, bool known,
case DID_UNCHIVALRIC_ATTACK:
case DID_POISON:
- if (you.religion == GOD_SHINING_ONE)
+ if (you.religion == GOD_SHINING_ONE
+ && (thing_done != DID_UNCHIVALRIC_ATTACK
+ || tso_unchivalric_attack_safe_monster(victim)))
{
ret = true;
piety_change = -level;