From c7a7fb4439a5f5006109abcd20cd0300f7d36827 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Wed, 21 Oct 2009 13:21:20 -0700 Subject: Don't disturb monsters witth their own sound A monster making noise was causing an ME_DISTURB behaviour_event() for itself, possibly causing it to get a new foe, which could cause strange results if it switched foes during the middle of spell-casting when it made noise from chanting. Now noisy() can accept a "who" parameter, in which case the monster which caused the noise will ignore the noise. This is done in all cases except for when a monster of animal or lower intelligence sets off an alarm trap or does a spell miscast. --- crawl-ref/source/fight.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crawl-ref/source/fight.cc') diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index e1e8d6b339..7366b7c29b 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -2647,7 +2647,7 @@ void melee_attack::chaos_affects_attacker() if (!msg.empty()) { mpr(msg.c_str(), MSGCH_SOUND); - noisy(15, attacker->pos()); + noisy(15, attacker->pos(), attacker->mindex()); #ifdef NOTE_DEBUG_CHAOS_EFFECTS take_note(Note(NOTE_MESSAGE, 0, 0, "CHAOS affects attacker: noise"), true); -- cgit v1.2.3-54-g00ecf