1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-17 01:32:21 +02:00

hide messages from AI

This commit is contained in:
Michael
2023-03-31 22:10:48 +02:00
committed by GitHub
parent a64f35c933
commit f7feeacc1f

View File

@ -4968,8 +4968,12 @@ bool CGameHandler::makeBattleAction(BattleAction &ba)
void CGameHandler::playerMessage(PlayerColor player, const std::string &message, ObjectInstanceID currObj) void CGameHandler::playerMessage(PlayerColor player, const std::string &message, ObjectInstanceID currObj)
{ {
bool cheated = false; 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; std::vector<std::string> words;
boost::split(words, message, boost::is_any_of(" ")); boost::split(words, message, boost::is_any_of(" "));