Skip to content

Commit

Permalink
Merge pull request liyunfan1223#503 from atidot3/master
Browse files Browse the repository at this point in the history
fix double chat
  • Loading branch information
liyunfan1223 authored Sep 1, 2024
2 parents 99c5cb4 + 5c33aca commit 452dc6f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/strategy/actions/SayAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 452dc6f

Please sign in to comment.