diff --git a/src/botlib.cpp b/src/botlib.cpp index ce47d9a..f100bf2 100644 --- a/src/botlib.cpp +++ b/src/botlib.cpp @@ -917,7 +917,7 @@ void Bot::instantChatter (int type) { void Bot::pushRadioMessage (int message) { // this function inserts the radio message into the message queue - if (cv_radio_mode.as () == 0 || m_numFriendsLeft == 0) { + if (cv_radio_mode.as () == 0 || m_numFriendsLeft == 0 || m_isCreature) { return; } m_forceRadio = !game.is (GameFlags::HasBotVoice) @@ -931,7 +931,7 @@ void Bot::pushRadioMessage (int message) { void Bot::pushChatterMessage (int message) { // this function inserts the voice message into the message queue (mostly same as above) - if (!game.is (GameFlags::HasBotVoice) || cv_radio_mode.as () != 2 || !conf.hasChatterBank (message) || m_numFriendsLeft == 0) { + if (!game.is (GameFlags::HasBotVoice) || m_isCreature || cv_radio_mode.as () != 2 || !conf.hasChatterBank (message) || m_numFriendsLeft == 0) { return; } bool sendMessage = false; @@ -2322,7 +2322,7 @@ void Bot::checkRadioQueue () { // don't allow bot listen you if bot is busy - if (getCurrentTaskId () == Task::DefuseBomb || getCurrentTaskId () == Task::PlantBomb || m_hasHostage || m_hasC4) { + if (getCurrentTaskId () == Task::DefuseBomb || getCurrentTaskId () == Task::PlantBomb || m_hasHostage || m_hasC4 || m_isCreature) { m_radioOrder = 0; return; } diff --git a/src/chatlib.cpp b/src/chatlib.cpp index 353b898..47d37be 100644 --- a/src/chatlib.cpp +++ b/src/chatlib.cpp @@ -374,7 +374,7 @@ void Bot::checkForChat () { void Bot::sendToChat (StringRef message, bool teamOnly) { // this function prints saytext message to all players - if (message.empty () || !cv_chat) { + if (m_isCreature || message.empty () || !cv_chat) { return; } issueCommand ("%s \"%s\"", teamOnly ? "say_team" : "say", message); diff --git a/src/engine.cpp b/src/engine.cpp index a1f7d12..95b48f5 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -1172,25 +1172,29 @@ void Game::ensureHealthyGameEnvironment () { return; } + auto notifyPeacefulRevert = [] (const ConVar &cv) { + game.print ("Cvar \"%s\" reverted to peaceful value.", cv.name ()); + }; + // disable fake latency if (cv_show_latency.as () > 1) { cv_show_latency.set (0); - game.print ("Cvar \"%s_show_latency\" reverted to peaceful value.", product.cmdPri); + notifyPeacefulRevert (cv_show_latency); } // disable fake avatars if (cv_show_avatars) { cv_show_avatars.set (0); - game.print ("Cvar \"%s_show_avatars\" reverted to peaceful value.", product.cmdPri); + notifyPeacefulRevert (cv_show_avatars); } // disable fake queries if (cv_enable_query_hook) { cv_enable_query_hook.set (0); - game.print ("Cvar \"%s_enable_query_hook\" reverted to peaceful value.", product.cmdPri); + notifyPeacefulRevert (cv_enable_query_hook); } }