From 5a1d8fac0e8a03203cfae06edf164e6d1e008855 Mon Sep 17 00:00:00 2001 From: mittorn Date: Mon, 9 Jan 2017 19:24:35 +0000 Subject: [PATCH] Enable chatter --- dlls/bot/cs_bot_chatter.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/dlls/bot/cs_bot_chatter.cpp b/dlls/bot/cs_bot_chatter.cpp index 5c8125ee..bfe88f4a 100644 --- a/dlls/bot/cs_bot_chatter.cpp +++ b/dlls/bot/cs_bot_chatter.cpp @@ -1003,6 +1003,7 @@ void BotStatement::AppendPhrase(ContextType contextPhrase) // Say our statement // m_index refers to the phrase currently being spoken, or -1 if we havent started yet +extern int gmsgSayText; bool BotStatement::Update() { @@ -1171,7 +1172,8 @@ bool BotStatement::Update() else { // me->SendRadioMessage(radioEvent); - me->GetChatter()->ResetRadioSilenceDuration(); + + //me->GetChatter()->ResetRadioSilenceDuration(); duration = 2.0f; } } @@ -1181,6 +1183,13 @@ bool BotStatement::Update() me->GetChatter()->ResetRadioSilenceDuration(); // me->StartVoiceFeedback(duration + 1.0f); } + // print to the sending client + char message[256]; + Q_snprintf( message, 256, "[bot] %s (radio): %s", STRING( me->pev->netname), phrase->GetName() ); + MESSAGE_BEGIN( MSG_ALL, gmsgSayText, NULL ); + WRITE_BYTE( ENTINDEX(me->edict()) ); + WRITE_STRING( message ); + MESSAGE_END(); } } @@ -1606,12 +1615,12 @@ BotStatement *BotChatterInterface::GetActiveStatement() bool BotChatterInterface::ShouldSpeak() const { // don't talk to non-existent friends - if (m_me->GetFriendsRemaining() == 0) - return false; + //if (m_me->GetFriendsRemaining() == 0) + //return false; // if everyone is together, no need to tell them what's going on - if (m_me->GetNearbyFriendCount() == m_me->GetFriendsRemaining()) - return false; + //if (m_me->GetNearbyFriendCount() == m_me->GetFriendsRemaining()) + //return false; return true; }