From 7011b893af476de00a276c7c6c53fc66a80d2dbb Mon Sep 17 00:00:00 2001 From: samisalreadytaken <46823719+samisalreadytaken@users.noreply.github.com> Date: Fri, 2 Dec 2022 22:31:24 +0300 Subject: [PATCH] Fix `CHudMessage::MessageDrawScan` ignoring custom font size --- sp/src/game/client/message.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sp/src/game/client/message.cpp b/sp/src/game/client/message.cpp index dc41bb00..e750da40 100644 --- a/sp/src/game/client/message.cpp +++ b/sp/src/game/client/message.cpp @@ -447,6 +447,8 @@ void CHudMessage::MessageScanStart( void ) break; } + // Font was just set in MessageDrawScan() +#ifndef MAPBASE m_parms.font = g_hFontTrebuchet24; if ( m_parms.vguiFontName != NULL && @@ -455,6 +457,7 @@ void CHudMessage::MessageScanStart( void ) SetFont( vgui::scheme()->GetDefaultScheme(), m_parms.vguiFontName ); } +#endif } //----------------------------------------------------------------------------- @@ -497,7 +500,19 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time ) m_parms.totalWidth = 0; m_parms.vguiFontName = pMessage->pVGuiSchemeFontName; +#ifdef MAPBASE + if ( m_parms.vguiFontName != NULL && + m_parms.vguiFontName[ 0 ] ) + { + SetFont( vgui::scheme()->GetDefaultScheme(), m_parms.vguiFontName ); + } + else + { + m_parms.font = g_hFontTrebuchet24; + } +#else m_parms.font = g_hFontTrebuchet24; +#endif while ( *pText ) {