Skip to content

Commit

Permalink
Config: Fix returned game INI filenames for title IDs
Browse files Browse the repository at this point in the history
Using the first letter or the 3 letters of the ID only makes sense
if the ID is an actual game ID (which has 6 characters).
  • Loading branch information
leoetlino committed Jul 31, 2017
1 parent ed33191 commit 603762e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ std::vector<std::string> GetGameIniFilenames(const std::string& id, std::optiona
if (id.empty())
return filenames;

// INIs that match the system code (unique for each Virtual Console system)
filenames.push_back(id.substr(0, 1) + ".ini");
// Using the first letter or the 3 letters of the ID only makes sense
// if the ID is an actual game ID (which has 6 characters).
if (id.length() == 6)
{
// INIs that match the system code (unique for each Virtual Console system)
filenames.push_back(id.substr(0, 1) + ".ini");

// INIs that match all regions
if (id.size() >= 4)
// INIs that match all regions
filenames.push_back(id.substr(0, 3) + ".ini");
}

// Regular INIs
filenames.push_back(id + ".ini");
Expand Down

0 comments on commit 603762e

Please sign in to comment.