[Bots] Cleanup Say Event Parse. (#2557)

This commit is contained in:
Kinglykrab 2022-11-20 15:28:46 -05:00 committed by GitHub
parent f67767f28e
commit 37af643b61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1219,7 +1219,11 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
#ifdef BOTS
else if (GetTarget() && GetTarget()->IsBot() && !IsInvisible(GetTarget())) {
if (DistanceNoZ(m_Position, GetTarget()->GetPosition()) <= RuleI(Range, Say)) {
parse->EventBot(GetTarget()->IsEngaged() ? EVENT_AGGRO_SAY : EVENT_SAY, GetTarget()->CastToBot(), this, message, language);
if (GetTarget()->IsEngaged()) {
parse->EventBot(EVENT_AGGRO_SAY, GetTarget()->CastToBot(), this, message, language);
} else {
parse->EventBot(EVENT_SAY, GetTarget()->CastToBot(), this, message, language);
}
}
}
#endif