Merge pull request #503 from atidot3/master

fix double chat
This commit is contained in:
Yunfan Li
2024-09-01 12:57:19 +08:00
committed by GitHub

View File

@@ -510,9 +510,11 @@ bool ChatReplyAction::SendGeneralResponse(Player* bot, ChatChannelSource chatCha
}
case ChatChannelSource::SRC_GENERAL:
{
//may reply to the same channel or whisper
GET_PLAYERBOT_AI(bot)->SayToChannel(responseMessage, ChatChannelId::GENERAL);
GET_PLAYERBOT_AI(bot)->Whisper(responseMessage, name);
//may reply to the same channel 80% or whisper
if (urand(0, 100) < 80)
GET_PLAYERBOT_AI(bot)->SayToChannel(responseMessage, ChatChannelId::GENERAL);
else
GET_PLAYERBOT_AI(bot)->Whisper(responseMessage, name);
break;
}
case ChatChannelSource::SRC_TRADE: