mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12:00
Have trophy manager reject games that have invalid usr data rather than dying.
This commit is contained in:
parent
b8c29ae957
commit
3288050680
1 changed files with 8 additions and 0 deletions
|
@ -72,6 +72,7 @@ trophy_manager_dialog::trophy_manager_dialog() : QWidget(), m_sort_column(0), m_
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::string dirName = sstr(dir_iter.fileName());
|
std::string dirName = sstr(dir_iter.fileName());
|
||||||
|
LOG_TRACE(GENERAL, "Loading trophy dir: %s", dirName);
|
||||||
LoadTrophyFolderToDB(dirName);
|
LoadTrophyFolderToDB(dirName);
|
||||||
dir_iter.next();
|
dir_iter.next();
|
||||||
}
|
}
|
||||||
|
@ -166,6 +167,12 @@ bool trophy_manager_dialog::LoadTrophyFolderToDB(const std::string& trop_name)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (game_trophy_data->trop_usr->GetTrophiesCount() == 0)
|
||||||
|
{
|
||||||
|
LOG_ERROR(GENERAL, "Warning game %s in trophy folder %s usr file reports zero trophies. Cannot load in trophy manager.", game_trophy_data->game_name, game_trophy_data->path);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
for (int trophy_id = 0; trophy_id < game_trophy_data->trop_usr->GetTrophiesCount(); ++trophy_id)
|
for (int trophy_id = 0; trophy_id < game_trophy_data->trop_usr->GetTrophiesCount(); ++trophy_id)
|
||||||
{
|
{
|
||||||
// Figure out how many zeros are needed for padding. (either 0, 1, or 2)
|
// Figure out how many zeros are needed for padding. (either 0, 1, or 2)
|
||||||
|
@ -324,6 +331,7 @@ void trophy_manager_dialog::PopulateUI()
|
||||||
{
|
{
|
||||||
auto& data = m_trophies_db[i];
|
auto& data = m_trophies_db[i];
|
||||||
|
|
||||||
|
LOG_TRACE(GENERAL, "Populating Trophy Manager UI with %s %s", data->game_name, data->path);
|
||||||
std::shared_ptr<rXmlNode> trophy_base = data->trop_config.GetRoot();
|
std::shared_ptr<rXmlNode> trophy_base = data->trop_config.GetRoot();
|
||||||
if (trophy_base->GetChildren()->GetName() == "trophyconf")
|
if (trophy_base->GetChildren()->GetName() == "trophyconf")
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue