summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/ISOFile.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2016-06-05 09:29:51 +0200
committerPierre Bourdon <delroth@gmail.com>2016-06-05 09:29:51 +0200
commitc514a48f4d279919e5bc2e34e205ef604f611af0 (patch)
treee6b890f20a29562eeb43f256f50eb111bcacf06e /Source/Core/DolphinWX/ISOFile.cpp
parent96acd3e7ff21db52ffc6be6a0e8c9d99fe261c4d (diff)
parent309d0e59f4697fdfc2763c7d3ee0075c514abe9b (diff)
Merge pull request #3776 from EmptyChaos/ar-isoprop-corrupt
ActionReplay: Fix ISOProperties corrupting active code set
Diffstat (limited to 'Source/Core/DolphinWX/ISOFile.cpp')
-rw-r--r--Source/Core/DolphinWX/ISOFile.cpp46
1 files changed, 28 insertions, 18 deletions
diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp
index 3312394dda..886837af52 100644
--- a/Source/Core/DolphinWX/ISOFile.cpp
+++ b/Source/Core/DolphinWX/ISOFile.cpp
@@ -124,27 +124,19 @@ GameListItem::GameListItem(const std::string& _rFileName, const std::unordered_m
if (IsValid())
{
- IniFile ini = SConfig::LoadGameIni(m_UniqueID, m_Revision);
- ini.GetIfExists("EmuState", "EmulationStateId", &m_emu_state);
- ini.GetIfExists("EmuState", "EmulationIssues", &m_issues);
- m_has_custom_name = ini.GetIfExists("EmuState", "Title", &m_custom_name);
+ std::string game_id = m_UniqueID;
- if (!m_has_custom_name)
+ // Ignore publisher ID for WAD files
+ if (m_Platform == DiscIO::IVolume::WII_WAD && game_id.size() > 4)
+ game_id.erase(4);
+
+ auto it = custom_titles.find(game_id);
+ if (it != custom_titles.end())
{
- std::string game_id = m_UniqueID;
-
- // Ignore publisher ID for WAD files
- if (m_Platform == DiscIO::IVolume::WII_WAD && game_id.size() > 4)
- game_id.erase(4);
-
- auto end = custom_titles.end();
- auto it = custom_titles.find(game_id);
- if (it != end)
- {
- m_custom_name = it->second;
- m_has_custom_name = true;
- }
+ m_custom_name_titles_txt = it->second;
}
+
+ ReloadINI();
}
if (!IsValid() && IsElfOrDol())
@@ -183,6 +175,24 @@ GameListItem::~GameListItem()
{
}
+void GameListItem::ReloadINI()
+{
+ if (!IsValid())
+ return;
+
+ IniFile ini = SConfig::LoadGameIni(m_UniqueID, m_Revision);
+ ini.GetIfExists("EmuState", "EmulationStateId", &m_emu_state, 0);
+ ini.GetIfExists("EmuState", "EmulationIssues", &m_issues, std::string());
+
+ m_custom_name.clear();
+ m_has_custom_name = ini.GetIfExists("EmuState", "Title", &m_custom_name);
+ if (!m_has_custom_name && !m_custom_name_titles_txt.empty())
+ {
+ m_custom_name = m_custom_name_titles_txt;
+ m_has_custom_name = true;
+ }
+}
+
bool GameListItem::LoadFromCache()
{
return CChunkFileReader::Load<GameListItem>(CreateCacheFilename(), CACHE_REVISION, *this);