diff options
| author | Leo Lam <leolino.lam@gmail.com> | 2017-07-31 22:43:15 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-07-31 22:43:15 +0800 |
| commit | fa0c699cd9061d010bbbc7f672a7b4f9afd146fc (patch) | |
| tree | bcbaee954768496c4792e98b2e2a40f40c0a7b30 /Source | |
| parent | ed331918f0f7a8836cda9f34df4a7ef86cd55e0d (diff) | |
| parent | 603762ec4d33c7200fb71d2d9bb6827bf7b3e019 (diff) | |
Merge pull request #5854 from leoetlino/gameini-names
Config: Fix returned game INI filenames for title IDs
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp b/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp index db7d15579c..84b6f41267 100644 --- a/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp +++ b/Source/Core/Core/ConfigLoaders/GameConfigLoader.cpp @@ -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"); |
