fix local profile switching stuck if current local profileID doesn't exist

fix local profile loading broken because dir missing trailing slash
This commit is contained in:
Chris Danford
2005-08-14 20:31:20 +00:00
parent e50a401341
commit 760ca931bc
4 changed files with 33 additions and 29 deletions
+13 -15
View File
@@ -195,27 +195,25 @@ void ScreenTitleMenu::ChangeDefaultLocalProfile( PlayerNumber pn, int iDir )
int iIndex = 0;
vector<CString>::const_iterator iter = find( vsProfileID.begin(), vsProfileID.end(), sCurrent );
if( iter != vsProfileID.end() )
{
iIndex = iter - vsProfileID.begin();
for( int i=0; i<PROFILEMAN->GetNumLocalProfiles(); i++ )
{
iIndex += iDir;
wrap( iIndex, vsProfileID.size() );
sCurrent = vsProfileID[iIndex];
for( int i=0; i<PROFILEMAN->GetNumLocalProfiles(); i++ )
{
iIndex += iDir;
wrap( iIndex, vsProfileID.size() );
sCurrent = vsProfileID[iIndex];
bool bAnyOtherIsUsingThisProfile = false;
FOREACH_PlayerNumber( p )
bool bAnyOtherIsUsingThisProfile = false;
FOREACH_PlayerNumber( p )
{
if( p!=pn && PREFSMAN->GetDefaultLocalProfileID(p).Get() == sCurrent )
{
if( p!=pn && PREFSMAN->GetDefaultLocalProfileID(p).Get() == sCurrent )
{
bAnyOtherIsUsingThisProfile = true;
break;
}
}
if( !bAnyOtherIsUsingThisProfile )
bAnyOtherIsUsingThisProfile = true;
break;
}
}
if( !bAnyOtherIsUsingThisProfile )
break;
}
m_soundProfileChange.Play();