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.
X4VO6QMQL7BISFKREOENAPNKIIKGFNNKX33DUEI7PRO7U6O2XQYQC UFM4NF5VT5UMB2EODBBWHH5A6VWD67MBVSY352K5MNTJVNNHYFLQC 7VZONIM2YB72XCATLVOJXHTZVEPPHJR54BU5UJANUYA5V6HFMEFQC X3JAMTLR5H345ZAHGB5JYQWA6FTIGVIZPMTVVGQRWEWLL4JHAWJQC MSAKGNFG6YXVCQNXIKGRSSRROZSPQLKYVUD4ISYEAGFVXYA4GLKAC K2CS6TCX2NDVL2ASEHGP4J4K4IJ6FP3ANNKTSIWVG43HPYSBX6ZQC TJN537N2F5J7JWBCT2Z4VSTNXIMFCMEXTKTY7N2UCXIVUUQ3XJBQC TGJZXTUIAKCFZQJ54ZQEBGFBVZSJCAX6AWDRSH3TP7UJRLGUM5SAC RPOZZWKG5GLPHVZZ7ZKMKS64ZMV2LDCQSARBJFJ6FZOTOKCQO7FAC CK7CT5TUFUL2AQY7FUHB5JI3FC2KSPWUWHXC6VEUJJ7G4OWUQFTAC SVY2PTCLXR3KNPQAWXVXTTGCC5DR334HOAKHYO3VDDRWM2BWMALAC IPPPBA4G2LODBP3EJIYGUAAOMHKLNBXHBD7KVX2JVDTA4DETHO4AC ZEFGFQHN6J2S6EIPX7EPDG22C5YXTI6DMKQHHRCLWN5MQC44KY3AC 3CMMAOYW3XCVFBCT2RT6YH5BLVAWQT62QXXWWCMWIZKDFZBY4M2QC BUSA7O6EFBZVAG2RL5T7MD2WTWKOEKKIAAZ2VS4Y3L6ECT4HQR6QC 23S5SPIJC5VOGKB5RQ3VEEXPUERPYT6WIR54FUSCRENQNGDHUF7AC LJK4ZQATLSB4MKZG3ARZX5V6RFGTN3NLCN6GTCUGJQKU26SOXMUAC JESCEQPAFC23D6BUZMBOB4M54XT3GQZJYT7NCJ556LEUCHRER3SQC QCIPZ52TOIKLA6O22P7USLEAYI4VAZRLGVXMAASSGEP37KN5PEVAC 542UIZKI65UDRNEMGFFDBWYD5XC7AYLTZ3JZQRR2GHYJALD3YY6QC RQ24Y25QDO2GY65XESEVBCP6VXCB7BDTWXO42IPPI6UPRJQ5XYDAC CDEJUVHMOT2SRPKWBB5IUPAXPGX6TUTGRBFLSPTR4XNZABDLSNUQC UADYVV3UD5ERJTZZJGY4EUQ4NJ2JSBG7YYUJ75ZRBIXRQXQKOJPAC noisy(12, this->pos, (you_trigger ? message_here :(in_sight ? message_near : message_far)));
const char* msg = (you_trigger ? message_here :(in_sight ? message_near : message_far));// Monsters of normal or greater intelligence will realize that// they were the one to set off the trap.int source = !m ? you.mindex() :mons_intel(m) >= I_NORMAL ? m->mindex() : -1;noisy(12, this->pos, msg, source);
noisy(sound_loudness, target->pos());
{// Those monsters of normal or greater intelligence will realize that they// were the source of the sound.int source = target->atype() == ACT_PLAYER ? you.mindex(): mons_intel(target_as_monster()) >= I_NORMAL ? target->mindex(): -1;noisy(sound_loudness, target->pos(), source);}