Fix issue 585: editor crash w/o saving.

This does not feel like a proper cure, but it does
stop the crashing.
This commit is contained in:
Jason Felds
2011-10-17 21:37:30 -04:00
parent 95c3bcb39a
commit b86a82fb42
2 changed files with 15 additions and 6 deletions
+10 -6
View File
@@ -1079,14 +1079,18 @@ void NoteField::DrawPrimitives()
AttackArray &attacks = GAMESTATE->m_bIsUsingStepTiming ?
GAMESTATE->m_pCurSteps[PLAYER_1]->m_Attacks :
GAMESTATE->m_pCurSong->m_Attacks;
FOREACH_CONST(Attack, attacks, a)
// XXX: We're somehow getting here when attacks is null. Find the actual cause later.
if (&attacks)
{
float fBeat = timing.GetBeatFromElapsedTime(a->fStartSecond);
if (BeatToNoteRow(fBeat) >= iFirstRowToDraw &&
BeatToNoteRow(fBeat) <= iLastRowToDraw &&
IS_ON_SCREEN(fBeat))
FOREACH_CONST(Attack, attacks, a)
{
this->DrawAttackText(fBeat, *a);
float fBeat = timing.GetBeatFromElapsedTime(a->fStartSecond);
if (BeatToNoteRow(fBeat) >= iFirstRowToDraw &&
BeatToNoteRow(fBeat) <= iLastRowToDraw &&
IS_ON_SCREEN(fBeat))
{
this->DrawAttackText(fBeat, *a);
}
}
}
}