Skip to content

Commit

Permalink
Improved error message for module load failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ccw808 committed Oct 18, 2016
1 parent 35fef00 commit 48c5cf8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Client/core/CCore.cpp
Expand Up @@ -912,8 +912,19 @@ void LoadModule ( CModuleLoader& m_Loader, const SString& strName, const SString

if ( m_Loader.IsOk () == false )
{
SString strMessage( "Error loading %s module! (%s)", *strName.ToLower (), *m_Loader.GetLastErrorMessage () );
BrowseToSolution ( "module-not-loadable&name=" + strModuleName, ASK_GO_ONLINE | TERMINATE_PROCESS, strMessage );
SString strMessage( "Error loading '%s' module!\n%s", *strName, *m_Loader.GetLastErrorMessage () );
SString strType = "module-not-loadable&name=" + strModuleName;

// Extra message if d3d9.dll exists
SString strD3dModuleFilename = PathJoin( GetLaunchPath(), "d3d9.dll" );
if ( FileExists( strD3dModuleFilename ) )
{
strMessage += "\n\n";
strMessage += _("TO FIX, REMOVE THIS FILE:") + "\n";
strMessage += strD3dModuleFilename;
strType += "&d3d9=1";
}
BrowseToSolution ( strType, ASK_GO_ONLINE | EXIT_GAME_FIRST, strMessage );
}
// Restore current directory
SetCurrentDirectory ( strSavedCwd );
Expand Down

0 comments on commit 48c5cf8

Please sign in to comment.