Skip to content

Commit 48c5cf8

Browse files
committed
Improved error message for module load failure
1 parent 35fef00 commit 48c5cf8

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Client/core/CCore.cpp

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,19 @@ void LoadModule ( CModuleLoader& m_Loader, const SString& strName, const SString
912912

913913
if ( m_Loader.IsOk () == false )
914914
{
915-
SString strMessage( "Error loading %s module! (%s)", *strName.ToLower (), *m_Loader.GetLastErrorMessage () );
916-
BrowseToSolution ( "module-not-loadable&name=" + strModuleName, ASK_GO_ONLINE | TERMINATE_PROCESS, strMessage );
915+
SString strMessage( "Error loading '%s' module!\n%s", *strName, *m_Loader.GetLastErrorMessage () );
916+
SString strType = "module-not-loadable&name=" + strModuleName;
917+
918+
// Extra message if d3d9.dll exists
919+
SString strD3dModuleFilename = PathJoin( GetLaunchPath(), "d3d9.dll" );
920+
if ( FileExists( strD3dModuleFilename ) )
921+
{
922+
strMessage += "\n\n";
923+
strMessage += _("TO FIX, REMOVE THIS FILE:") + "\n";
924+
strMessage += strD3dModuleFilename;
925+
strType += "&d3d9=1";
926+
}
927+
BrowseToSolution ( strType, ASK_GO_ONLINE | EXIT_GAME_FIRST, strMessage );
917928
}
918929
// Restore current directory
919930
SetCurrentDirectory ( strSavedCwd );

0 commit comments

Comments
 (0)