Fixed broken definition of pit speed limit depending on pit side

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

Former-commit-id: abd0cf2623482df758d167e44aac75b35b1f59c1
Former-commit-id: 80e38e719b276b6c75b2152f165c2b10493a6363
This commit is contained in:
wdbee 2016-03-29 18:27:45 +00:00
parent a7d9d41c55
commit 92f3c5a1d4
3 changed files with 110 additions and 65 deletions

View file

@ -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) {

View file

@ -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;

View file

@ -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;