Don't crash if we're not editing a course entry.

This commit is contained in:
Steve Checkoway
2006-06-24 07:46:17 +00:00
parent f7494da13e
commit 1e7852ed1f
+4
View File
@@ -1699,6 +1699,8 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
case EDIT_BUTTON_OPEN_COURSE_ATTACK_MENU:
{
Course *pCourse = GAMESTATE->m_pCurCourse;
if( pCourse == NULL )
break;
CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
float fStartTime = m_pSong->GetElapsedTimeFromBeat( GAMESTATE->m_fSongBeat );
int iAttack = FindAttackAtTime( ce.attacks, fStartTime );
@@ -1730,6 +1732,8 @@ void ScreenEdit::InputEdit( const InputEventPlus &input, EditButton EditB )
float fStart, fEnd;
PlayerOptions po;
const Course *pCourse = GAMESTATE->m_pCurCourse;
if( pCourse == NULL )
break;
const CourseEntry &ce = pCourse->m_vEntries[GAMESTATE->m_iEditCourseEntryIndex];
if( m_NoteFieldEdit.m_iBeginMarker == -1 )