From 26d4fac2aa63f3b4a61599e1d4cd1a875eebb329 Mon Sep 17 00:00:00 2001 From: Roman Chistokhodov Date: Sun, 3 Sep 2023 15:54:48 +0300 Subject: [PATCH] Respect hud_saytext cvar. Remove redundant print to console (#387) --- cl_dll/saytext.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cl_dll/saytext.cpp b/cl_dll/saytext.cpp index 35d08bec..8a4bd1aa 100644 --- a/cl_dll/saytext.cpp +++ b/cl_dll/saytext.cpp @@ -100,10 +100,11 @@ int CHudSayText::Draw( float flTime ) int y = Y_START; #if USE_VGUI - if( ( gViewPort && gViewPort->AllowedToPrintText() == FALSE ) || !m_HUD_saytext->value ) + if( ( gViewPort && gViewPort->AllowedToPrintText() == FALSE ) ) return 1; #endif - + if ( !m_HUD_saytext->value ) + return 1; // make sure the scrolltime is within reasonable bounds, to guard against the clock being reset flScrollTime = Q_min( flScrollTime, flTime + m_HUD_saytext_time->value ); @@ -173,8 +174,6 @@ void CHudSayText::SayTextPrint( const char *pszBuf, int iBufSize, int clientInde ConsolePrint( pszBuf ); return; } -#else - ConsolePrint( pszBuf ); #endif int i;