1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Merge pull request #1813 from Laserlicht/patch-1

hide messages from AI
This commit is contained in:
Ivan Savenko 2023-04-02 20:08:45 +03:00 committed by GitHub
commit 2b1def4ef1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4969,8 +4969,12 @@ bool CGameHandler::makeBattleAction(BattleAction &ba)
void CGameHandler::playerMessage(PlayerColor player, const std::string &message, ObjectInstanceID currObj)
{
bool cheated = false;
PlayerMessageClient temp_message(player, message);
sendAndApply(&temp_message);
if(!getPlayerSettings(player)->isControlledByAI())
{
PlayerMessageClient temp_message(player, message);
sendAndApply(&temp_message);
}
std::vector<std::string> words;
boost::split(words, message, boost::is_any_of(" "));