diff --git a/src/modules/track/trackv1/track3.cpp b/src/modules/track/trackv1/track3.cpp index 342e09c75..2a93226c9 100644 --- a/src/modules/track/trackv1/track3.cpp +++ b/src/modules/track/trackv1/track3.cpp @@ -1539,34 +1539,49 @@ ReadTrack3(tTrack *theTrack, void *TrackHandle, tRoadCam **camList, int ext) i++; } - /* THIS CODE DOES NOTHING >>> */ + // Setup pit speed limit for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) { curSeg = curSeg2 = NULL; + switch(pits->side) { + + case TR_RGT: + curSeg = mSeg->rside; + if (curSeg) + curSeg2 = curSeg->rside; + break; + + case TR_LFT: + curSeg = mSeg->lside; + if (curSeg) + curSeg2 = curSeg->lside; + break; + + } + if ((mSeg != pitStart->prev) && (mSeg != pitEnd->next)) { if (curSeg) { curSeg->raceInfo |= TR_PIT | TR_SPEEDLIMIT; - } - if (curSeg2) { - curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT; + if (curSeg2) { + curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT; + } } } else if (mSeg == pitStart->prev) { if (curSeg) { curSeg->raceInfo |= TR_PITSTART; - } - if (curSeg2) { - curSeg2->raceInfo |= TR_PITSTART; + if (curSeg2) { + curSeg2->raceInfo |= TR_PITSTART; + } } } else if (mSeg == pitEnd->next) { if (curSeg) { curSeg->raceInfo |= TR_PITEND; + if (curSeg2) { + curSeg2->raceInfo |= TR_PITEND; + } } - if (curSeg2) { - curSeg2->raceInfo |= TR_PITEND; - } } } - /* <<< THIS CODE DOES NOTHING */ } for (mSeg = pitBuildingsStart; mSeg != pitBuildingsEnd; mSeg = mSeg->next) { diff --git a/src/modules/track/trackv1/track4.cpp b/src/modules/track/trackv1/track4.cpp index cc061932a..02da99957 100644 --- a/src/modules/track/trackv1/track4.cpp +++ b/src/modules/track/trackv1/track4.cpp @@ -1086,34 +1086,49 @@ static void AddPitDoors(tTrack *theTrack, void *TrackHandle, bool found) { }//while i GfLogDebug("\n"); - /* THIS CODE DOES NOTHING >>> */ - for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) { - curSeg = curSeg2 = NULL; + // Setup pit speed limit + for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) { + curSeg = curSeg2 = NULL; - if ((mSeg != pitStart->prev) && (mSeg != pitEnd->next)) { - if (curSeg) { - curSeg->raceInfo |= TR_PIT | TR_SPEEDLIMIT; - } - if (curSeg2) { - curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT; - } - } else if (mSeg == pitStart->prev) { - if (curSeg) { - curSeg->raceInfo |= TR_PITSTART; - } - if (curSeg2) { - curSeg2->raceInfo |= TR_PITSTART; - } - } else if (mSeg == pitEnd->next) { - if (curSeg) { - curSeg->raceInfo |= TR_PITEND; - } - if (curSeg2) { - curSeg2->raceInfo |= TR_PITEND; - } - } - }//for mSeg - /* <<< THIS CODE DOES NOTHING */ + switch(pits->side) { + + case TR_RGT: + curSeg = mSeg->rside; + if (curSeg) + curSeg2 = curSeg->rside; + break; + + case TR_LFT: + curSeg = mSeg->lside; + if (curSeg) + curSeg2 = curSeg->lside; + break; + + } + + if ((mSeg != pitStart->prev) && (mSeg != pitEnd->next)) { + if (curSeg) { + curSeg->raceInfo |= TR_PIT | TR_SPEEDLIMIT; + if (curSeg2) { + curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT; + } + } + } else if (mSeg == pitStart->prev) { + if (curSeg) { + curSeg->raceInfo |= TR_PITSTART; + if (curSeg2) { + curSeg2->raceInfo |= TR_PITSTART; + } + } + } else if (mSeg == pitEnd->next) { + if (curSeg) { + curSeg->raceInfo |= TR_PITEND; + if (curSeg2) { + curSeg2->raceInfo |= TR_PITEND; + } + } + } + } }//dummy break; diff --git a/src/modules/track/trackv1/track5.cpp b/src/modules/track/trackv1/track5.cpp index 6b4b1fc00..46bac9665 100644 --- a/src/modules/track/trackv1/track5.cpp +++ b/src/modules/track/trackv1/track5.cpp @@ -1117,34 +1117,49 @@ static void AddPitDoors(tTrack *theTrack, void *TrackHandle, bool found) { }//while i GfLogDebug("\n"); - /* THIS CODE DOES NOTHING >>> */ - for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) { - curSeg = curSeg2 = NULL; + // Setup pit speed limit + for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) { + curSeg = curSeg2 = NULL; - if ((mSeg != pitStart->prev) && (mSeg != pitEnd->next)) { - if (curSeg) { - curSeg->raceInfo |= TR_PIT | TR_SPEEDLIMIT; - } - if (curSeg2) { - curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT; - } - } else if (mSeg == pitStart->prev) { - if (curSeg) { - curSeg->raceInfo |= TR_PITSTART; - } - if (curSeg2) { - curSeg2->raceInfo |= TR_PITSTART; - } - } else if (mSeg == pitEnd->next) { - if (curSeg) { - curSeg->raceInfo |= TR_PITEND; - } - if (curSeg2) { - curSeg2->raceInfo |= TR_PITEND; - } - } - }//for mSeg - /* <<< THIS CODE DOES NOTHING */ + switch(pits->side) { + + case TR_RGT: + curSeg = mSeg->rside; + if (curSeg) + curSeg2 = curSeg->rside; + break; + + case TR_LFT: + curSeg = mSeg->lside; + if (curSeg) + curSeg2 = curSeg->lside; + break; + + } + + if ((mSeg != pitStart->prev) && (mSeg != pitEnd->next)) { + if (curSeg) { + curSeg->raceInfo |= TR_PIT | TR_SPEEDLIMIT; + if (curSeg2) { + curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT; + } + } + } else if (mSeg == pitStart->prev) { + if (curSeg) { + curSeg->raceInfo |= TR_PITSTART; + if (curSeg2) { + curSeg2->raceInfo |= TR_PITSTART; + } + } + } else if (mSeg == pitEnd->next) { + if (curSeg) { + curSeg->raceInfo |= TR_PITEND; + if (curSeg2) { + curSeg2->raceInfo |= TR_PITEND; + } + } + } + } }//dummy break;