From 5c33aca6d33de9decf3527adac67976310460726 Mon Sep 17 00:00:00 2001 From: Atidot3 Date: Sat, 31 Aug 2024 22:53:57 +0200 Subject: [PATCH] fix double chat --- src/strategy/actions/SayAction.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/strategy/actions/SayAction.cpp b/src/strategy/actions/SayAction.cpp index 6bf973ab..81a7387b 100644 --- a/src/strategy/actions/SayAction.cpp +++ b/src/strategy/actions/SayAction.cpp @@ -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: