From 55960f7feb9bc1cfe025659ad253350660bcd735 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 6 May 2017 18:00:22 +0200 Subject: [PATCH 1/2] ISOFile/GameFile: Correct GetWiiFSPath condition This code was originally written when there only were three possible types, but nowadays we also have the DOL/ELF type. --- Source/Core/DolphinQt2/GameList/GameFile.cpp | 2 +- Source/Core/DolphinWX/ISOFile.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt2/GameList/GameFile.cpp b/Source/Core/DolphinQt2/GameList/GameFile.cpp index a23c7ab240..1088e66e82 100644 --- a/Source/Core/DolphinQt2/GameList/GameFile.cpp +++ b/Source/Core/DolphinQt2/GameList/GameFile.cpp @@ -336,7 +336,7 @@ bool GameFile::ExportWiiSave() QString GameFile::GetWiiFSPath() const { - _assert_(m_platform != DiscIO::Platform::GAMECUBE_DISC); + _assert_(m_platform == DiscIO::Platform::WII_DISC || m_platform == DiscIO::Platform::WII_WAD); const std::string path = Common::GetTitleDataPath(m_title_id, Common::FROM_CONFIGURED_ROOT); diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index ac4c901894..cba1f17d5e 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -363,7 +363,7 @@ const std::string GameListItem::GetWiiFSPath() const { std::string ret; - if (m_Platform != DiscIO::Platform::GAMECUBE_DISC) + if (m_Platform == DiscIO::Platform::WII_DISC || m_Platform == DiscIO::Platform::WII_WAD) { const std::string path = Common::GetTitleDataPath(m_title_id, Common::FROM_CONFIGURED_ROOT); From 9b8089bb70d787da4a3b083b17c434df17d90805 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 6 May 2017 18:32:17 +0200 Subject: [PATCH 2/2] ISOFile: Simplify error handling in GetWiiFSPath --- Source/Core/DolphinWX/ISOFile.cpp | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Source/Core/DolphinWX/ISOFile.cpp b/Source/Core/DolphinWX/ISOFile.cpp index cba1f17d5e..9e115a988d 100644 --- a/Source/Core/DolphinWX/ISOFile.cpp +++ b/Source/Core/DolphinWX/ISOFile.cpp @@ -361,20 +361,16 @@ std::vector GameListItem::GetLanguages() const const std::string GameListItem::GetWiiFSPath() const { - std::string ret; + if (m_Platform != DiscIO::Platform::WII_DISC && m_Platform != DiscIO::Platform::WII_WAD) + return ""; - if (m_Platform == DiscIO::Platform::WII_DISC || m_Platform == DiscIO::Platform::WII_WAD) - { - const std::string path = Common::GetTitleDataPath(m_title_id, Common::FROM_CONFIGURED_ROOT); + const std::string path = Common::GetTitleDataPath(m_title_id, Common::FROM_CONFIGURED_ROOT); - if (!File::Exists(path)) - File::CreateFullPath(path); + if (!File::Exists(path)) + File::CreateFullPath(path); - if (path[0] == '.') - ret = WxStrToStr(wxGetCwd()) + path.substr(strlen(ROOT_DIR)); - else - ret = path; - } + if (path[0] == '.') + return WxStrToStr(wxGetCwd()) + path.substr(strlen(ROOT_DIR)); - return ret; + return path; }