From 1444694325d900c87483e84ee5f2bfcac04bb3bf Mon Sep 17 00:00:00 2001 From: Charles Otto Date: Sun, 8 Nov 2009 15:43:17 -0500 Subject: 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. --- crawl-ref/source/fight.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crawl-ref') 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 = -- cgit v1.2.3-54-g00ecf