diff --git a/cl_dll/message.cpp b/cl_dll/message.cpp index a8665c9f..bbd59d9a 100644 --- a/cl_dll/message.cpp +++ b/cl_dll/message.cpp @@ -240,7 +240,7 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time ) { int i, j, length, width; const char *pText; - unsigned char line[80]; + const char *pLineStart; pText = pMessage->pMessage; // Count lines @@ -278,25 +278,21 @@ void CHudMessage::MessageDrawScan( client_textmessage_t *pMessage, float time ) { m_parms.lineLength = 0; m_parms.width = 0; + pLineStart = pText; while( *pText && *pText != '\n' ) { unsigned char c = *pText; - if (m_parms.lineLength < sizeof(line)-1) - { - line[m_parms.lineLength] = c; - m_parms.width += gHUD.m_scrinfo.charWidths[c]; - m_parms.lineLength++; - } + m_parms.width += gHUD.m_scrinfo.charWidths[c]; + m_parms.lineLength++; pText++; } pText++; // Skip LF - line[m_parms.lineLength] = 0; m_parms.x = XPosition( pMessage->x, m_parms.width, m_parms.totalWidth ); for( j = 0; j < m_parms.lineLength; j++ ) { - m_parms.text = line[j]; + m_parms.text = pLineStart[j]; int next = m_parms.x + gHUD.m_scrinfo.charWidths[m_parms.text]; MessageScanNextChar();