From 24f899df4143cf27c98b218da786de393578e765 Mon Sep 17 00:00:00 2001 From: dolorous Date: Tue, 17 Jun 2008 06:33:24 +0000 Subject: Fix attack conduct handling to register more than one conduct for an attack again. For example, if you make an unchivalric attack on a neutral monster, both the "unchivalric attack" and "attack neutral" conducts will be handled again, instead of just the former (big oops). Passing a constant-sized array of god_conduct_triggers and adding wrapper functions to enable and disable them all is not the most elegant solution, but I don't quite have the time or the understanding right now to rewrite the god_conduct_trigger class to handle more than one conduct at once, and this does work in the meantime. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5914 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/fight.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index a35f3a9c2e..8ca5e7f113 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -608,8 +608,8 @@ bool melee_attack::attack() check_autoberserk(); check_special_wield_effects(); - god_conduct_trigger conduct; - conduct.enabled = false; + god_conduct_trigger conducts[4]; + disable_attack_conducts(conducts); if (attacker->atype() == ACT_PLAYER) { @@ -619,7 +619,7 @@ bool melee_attack::attack() return (false); } else - set_attack_conducts(def, conduct); + set_attack_conducts(conducts, def); } // Trying to stay general beyond this point is a recipe for insanity. @@ -628,7 +628,7 @@ bool melee_attack::attack() (defender->atype() == ACT_PLAYER) ? mons_attack_you() : mons_attack_mons()); - conduct.enabled = true; + enable_attack_conducts(conducts); return retval; } -- cgit v1.2.3-54-g00ecf