Bugfix: handle special case when
the track has no pit section at all. Re #318. git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3305 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 3e44178e5c6ff229dd41ff33de77f157d232fee2 Former-commit-id: 33fe8e845a04159773ddb1da87ec5d002ba13fe9
This commit is contained in:
parent
078f3bfbda
commit
67b933ad19
1 changed files with 11 additions and 1 deletions
|
@ -762,11 +762,21 @@ AddSides(tTrackSeg *curSeg, void *TrackHandle, tTrack *theTrack, int curStep, in
|
||||||
static bool InitPits(tTrack *theTrack, void *TrackHandle) {
|
static bool InitPits(tTrack *theTrack, void *TrackHandle) {
|
||||||
int i;
|
int i;
|
||||||
int segId;
|
int segId;
|
||||||
|
|
||||||
|
//Set each pit-related ptr to initial value
|
||||||
|
pitEntrySeg = NULL;
|
||||||
|
pitExitSeg = NULL;
|
||||||
|
pitStart = NULL;
|
||||||
|
pitBuildingsStart = NULL;
|
||||||
|
pitEnd = NULL;
|
||||||
|
|
||||||
|
//Search for the pit section in the track XML file
|
||||||
pits = &(theTrack->pits);
|
pits = &(theTrack->pits);
|
||||||
sprintf(path2, "%s/%s", TRK_SECT_MAIN, TRK_SECT_PITS);
|
sprintf(path2, "%s/%s", TRK_SECT_MAIN, TRK_SECT_PITS);
|
||||||
char *segName = GfParmGetStrNC(TrackHandle, path2, TRK_ATT_ENTRY, NULL);
|
char *segName = GfParmGetStrNC(TrackHandle, path2, TRK_ATT_ENTRY, NULL);
|
||||||
|
|
||||||
|
//If there exists a pit section, we search and set each ptr
|
||||||
|
//to the appropriate part of the pit.
|
||||||
bool found = false;
|
bool found = false;
|
||||||
if (segName != 0) {
|
if (segName != 0) {
|
||||||
//Search for pit entry
|
//Search for pit entry
|
||||||
|
|
Loading…
Reference in a new issue