Movie: Simplify ChangeDisc path handling

This commit is contained in:
JosJuice 2016-07-05 21:13:43 +02:00
parent 1da866d7de
commit 865be48ee3
1 changed files with 6 additions and 8 deletions

View File

@ -1211,16 +1211,15 @@ void PlayController(GCPadStatus* PadStatus, int controllerID)
PadStatus->button |= PAD_TRIGGER_R; PadStatus->button |= PAD_TRIGGER_R;
if (s_padState.disc) if (s_padState.disc)
{ {
// This implementation assumes the disc change will only happen once. Trying to change more than // This implementation assumes the disc change will only happen once. Trying
// that will cause // to change more than that will cause it to load the last disc every time.
// it to load the last disc every time. As far as i know though, there are no 3+ disc games, so // As far as I know, there are no 3+ disc games, so this should be fine.
// this should be fine.
bool found = false; bool found = false;
std::string path; std::string path;
for (size_t i = 0; i < SConfig::GetInstance().m_ISOFolder.size(); ++i) for (const std::string& iso_folder : SConfig::GetInstance().m_ISOFolder)
{ {
path = SConfig::GetInstance().m_ISOFolder[i]; path = iso_folder + '/' + g_discChange;
if (File::Exists(path + '/' + g_discChange)) if (File::Exists(path))
{ {
found = true; found = true;
break; break;
@ -1228,7 +1227,6 @@ void PlayController(GCPadStatus* PadStatus, int controllerID)
} }
if (found) if (found)
{ {
path += '/' + g_discChange;
DVDInterface::ChangeDiscAsCPU(path); DVDInterface::ChangeDiscAsCPU(path);
} }
else else