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
commit 452dc6f814
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

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