summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
diff options
context:
space:
mode:
authorCharles Otto <ottochar@gmail.com>2009-11-08 15:43:17 -0500
committerCharles Otto <ottochar@gmail.com>2009-11-08 16:16:38 -0500
commit1444694325d900c87483e84ee5f2bfcac04bb3bf (patch)
tree5939f670f48f30299d68dab4eaf262eba95ede91 /crawl-ref/source/fight.cc
parentc445956fabba97f647a0e659cab6a15ddc019260 (diff)
downloadcrawl-ref-1444694325d900c87483e84ee5f2bfcac04bb3bf.tar.gz
crawl-ref-1444694325d900c87483e84ee5f2bfcac04bb3bf.zip
Prevent chaos weapons from using SPWPN_CONFUSE on the player
SPWPN_CONFUSE is what confusing touch uses to inflict confusion. The SPWPN_CONFUSE case in melee_attack::apply_damage_brand isn't set up to work on the player, and when that case came up with the player defending an assertion failure was triggered. I made the case in apply_damage_brand do nothing if used on the player. The case could be made more general, but it might make sense to implement a confuse brand specifically for chaose weapons since the HD check used for confusing touch isn't consistent with how the other chaos-weapon-caused status effects work.
Diffstat (limited to 'crawl-ref/source/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index 8aef88b8a3..5c5bb75b70 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -3332,6 +3332,12 @@ bool melee_attack::apply_damage_brand()
case SPWPN_CONFUSE:
{
+ // This was originally for confusing touch and it doesn't really
+ // work on the player, but a monster with a chaos weapon will
+ // occassionally come up with this brand. -cao
+ if (defender->atype() == ACT_PLAYER)
+ break;
+
emit_nodmg_hit_message();
const int hdcheck =