fix crash when selecting course mods in editor

This commit is contained in:
Chris Danford
2006-08-15 21:18:23 +00:00
parent c36f33c088
commit 42d279926b
2 changed files with 13 additions and 0 deletions
+11
View File
@@ -2406,7 +2406,18 @@ void ScreenEdit::HandleScreenMessage( const ScreenMessage SM )
{
const RString name = g_CourseMode.rows[0].choices[num];
Course *pCourse = SONGMAN->FindCourse( name );
int iCourseEntryIndex = -1;
FOREACH_CONST( CourseEntry, pCourse->m_vEntries, i )
{
if( i->pSong == GAMESTATE->m_pCurSong.Get() )
iCourseEntryIndex = i - pCourse->m_vEntries.begin();
}
ASSERT( iCourseEntryIndex != -1 );
GAMESTATE->m_pCurCourse.Set( pCourse );
GAMESTATE->m_iEditCourseEntryIndex.Set( iCourseEntryIndex );
ASSERT( GAMESTATE->m_pCurCourse );
}
}