Skip to content

Commit cce5c12

Browse files
committed
Test for font error at startup
1 parent 0feee13 commit cce5c12

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

MTA10/core/CGraphics.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,9 +1084,16 @@ bool CGraphics::LoadStandardDXFonts ( void )
10841084

10851085
for ( uint i = 0 ; i < m_FontResourceNames.size () ; i++ )
10861086
{
1087-
if ( !AddFontResourceEx ( CalcMTASAPath ( "MTA\\cgui\\" + m_FontResourceNames[i] ), FR_PRIVATE, 0 ) )
1087+
SString strPathFilename = CalcMTASAPath ( "MTA\\cgui\\" + m_FontResourceNames[i] );
1088+
if ( AddFontResourceEx ( strPathFilename, FR_PRIVATE, 0 ) )
10881089
{
1089-
BrowseToSolution ( "mta-datafiles-missing", EXIT_GAME_FIRST | ASK_GO_ONLINE, "Error loading MTA font " + m_FontResourceNames[i] );
1090+
SString strFileMd5 = GenerateHashHexStringFromFile ( EHashFunctionType::MD5, strPathFilename );
1091+
uint uiFileSize = (uint)FileSize( strPathFilename );
1092+
AddReportLog( 9442, SString( "Problem with AddFontResourceEx [MD5:%s Size:%d] %s ", *strFileMd5, uiFileSize, *strPathFilename ) );
1093+
if ( !FileExists( strPathFilename ) )
1094+
{
1095+
BrowseToSolution ( "mta-datafiles-missing", EXIT_GAME_FIRST | ASK_GO_ONLINE, "Error loading MTA font " + m_FontResourceNames[i] );
1096+
}
10901097
}
10911098
}
10921099

0 commit comments

Comments
 (0)