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
+5
View File
@@ -8,6 +8,11 @@ ________________________________________________________________________________
StepMania 5.0 $next | 2011xxxx StepMania 5.0 $next | 2011xxxx
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
2011/10/17
----------
* [ScreenEdit/NoteField] Fix an editor crash when you exit without saving
after creating new steps. [Wolfman2000]
2011/10/16 2011/10/16
---------- ----------
* [NoteDataUtil] Add the Backwards mod for games where the intended * [NoteDataUtil] Add the Backwards mod for games where the intended
+4
View File
@@ -1079,6 +1079,9 @@ void NoteField::DrawPrimitives()
AttackArray &attacks = GAMESTATE->m_bIsUsingStepTiming ? AttackArray &attacks = GAMESTATE->m_bIsUsingStepTiming ?
GAMESTATE->m_pCurSteps[PLAYER_1]->m_Attacks : GAMESTATE->m_pCurSteps[PLAYER_1]->m_Attacks :
GAMESTATE->m_pCurSong->m_Attacks; GAMESTATE->m_pCurSong->m_Attacks;
// XXX: We're somehow getting here when attacks is null. Find the actual cause later.
if (&attacks)
{
FOREACH_CONST(Attack, attacks, a) FOREACH_CONST(Attack, attacks, a)
{ {
float fBeat = timing.GetBeatFromElapsedTime(a->fStartSecond); float fBeat = timing.GetBeatFromElapsedTime(a->fStartSecond);
@@ -1090,6 +1093,7 @@ void NoteField::DrawPrimitives()
} }
} }
} }
}
if( !GAMESTATE->m_bIsUsingStepTiming ) if( !GAMESTATE->m_bIsUsingStepTiming )
{ {