Fixes #382 Crash when restarting a race on a track with lights (ex: Newton)

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3490 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 736494c88714133caaee6853aa02d1d292b3e4ef
Former-commit-id: e40fb53b427b554fa70f30b6dd5bcf5bf365e59d
This commit is contained in:
pouillot 2011-04-10 18:55:34 +00:00
parent 0083b6e6aa
commit 80734614db

View file

@ -310,6 +310,7 @@ static void manageStartLights( tTrackLights *startlights, tSituation *s, char ph
void grTrackLightInit()
{
statelist = NULL;
lightBranch = new ssgBranch();
TrackLightAnchor->addKid( lightBranch );
memset( &trackLights, 0, sizeof( tTrackLights ) );
@ -318,7 +319,7 @@ void grTrackLightInit()
void grTrackLightUpdate( tSituation *s )
{
char phase = ( (int)floor( fmod( s->currentTime + 120.0f, (double)0.3f ) / 0.3f ) % 2 ) + 1;
char phase = ( (int)floor( fmod( s->currentTime + 120.0f, (double)0.3f ) / 0.3f ) % 2 ) + 1;
manageStartLights( &trackLights, s, phase );
}