report errors in LoadEditableDataFromDir
This commit is contained in:
@@ -982,7 +982,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const
|
|||||||
return pGeneralDataNode;
|
return pGeneralDataNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Profile::LoadEditableDataFromDir( CString sDir )
|
Profile::LoadResult Profile::LoadEditableDataFromDir( CString sDir )
|
||||||
{
|
{
|
||||||
CString fn = sDir + EDITABLE_INI;
|
CString fn = sDir + EDITABLE_INI;
|
||||||
|
|
||||||
@@ -993,9 +993,11 @@ void Profile::LoadEditableDataFromDir( CString sDir )
|
|||||||
if( iBytes > MAX_EDITABLE_INI_SIZE_BYTES )
|
if( iBytes > MAX_EDITABLE_INI_SIZE_BYTES )
|
||||||
{
|
{
|
||||||
LOG->Warn( "The file '%s' is unreasonably large. It won't be loaded.", fn.c_str() );
|
LOG->Warn( "The file '%s' is unreasonably large. It won't be loaded.", fn.c_str() );
|
||||||
return;
|
return failed_tampered;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( !IsAFile(fn) )
|
||||||
|
return failed_no_profile;
|
||||||
|
|
||||||
IniFile ini;
|
IniFile ini;
|
||||||
ini.ReadFile( fn );
|
ini.ReadFile( fn );
|
||||||
@@ -1012,6 +1014,8 @@ void Profile::LoadEditableDataFromDir( CString sDir )
|
|||||||
// TODO: strip invalid chars?
|
// TODO: strip invalid chars?
|
||||||
if( m_iWeightPounds != 0 )
|
if( m_iWeightPounds != 0 )
|
||||||
CLAMP( m_iWeightPounds, 50, 500 );
|
CLAMP( m_iWeightPounds, 50, 500 );
|
||||||
|
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Profile::FastLoadProfileNameFromMemoryCard( CString sDir, CString &sName )
|
bool Profile::FastLoadProfileNameFromMemoryCard( CString sDir, CString &sName )
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ public:
|
|||||||
LoadResult LoadAllFromDir( CString sDir, bool bRequireSignature );
|
LoadResult LoadAllFromDir( CString sDir, bool bRequireSignature );
|
||||||
bool SaveAllToDir( CString sDir, bool bSignData ) const;
|
bool SaveAllToDir( CString sDir, bool bSignData ) const;
|
||||||
|
|
||||||
void LoadEditableDataFromDir( CString sDir );
|
LoadResult LoadEditableDataFromDir( CString sDir );
|
||||||
static bool FastLoadProfileNameFromMemoryCard( CString sDir, CString &sName );
|
static bool FastLoadProfileNameFromMemoryCard( CString sDir, CString &sName );
|
||||||
LoadResult LoadStatsXmlFromNode( const XNode* pNode );
|
LoadResult LoadStatsXmlFromNode( const XNode* pNode );
|
||||||
void LoadGeneralDataFromNode( const XNode* pNode );
|
void LoadGeneralDataFromNode( const XNode* pNode );
|
||||||
|
|||||||
Reference in New Issue
Block a user