Improve parsing custom game titles from titles.txt

Read game ID based on position of the "=" sign, rather than assuming game IDs are 6 characters in length.
This commit is contained in:
Stevoisiak 2015-03-21 17:31:29 -04:00 committed by Steven V
parent c2bbcdd16c
commit 90167abe0f
1 changed files with 3 additions and 2 deletions

View File

@ -407,9 +407,10 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
if (!std::getline(titlestxt, line) && titlestxt.eof())
break;
if (line.substr(0,rISOFile.GetUniqueID().size()) == rISOFile.GetUniqueID())
const size_t equals_index = line.find('=');
if (line.substr(0, equals_index - 1) == rISOFile.GetUniqueID())
{
name = StrToWxStr(line.substr(rISOFile.GetUniqueID().size() + 3));
name = StrToWxStr(line.substr(equals_index + 2));
break;
}
}