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++; i++;
} }
/* THIS CODE DOES NOTHING >>> */ // Setup pit speed limit
for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) { for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) {
curSeg = curSeg2 = NULL; 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 ((mSeg != pitStart->prev) && (mSeg != pitEnd->next)) {
if (curSeg) { if (curSeg) {
curSeg->raceInfo |= TR_PIT | TR_SPEEDLIMIT; curSeg->raceInfo |= TR_PIT | TR_SPEEDLIMIT;
} if (curSeg2) {
if (curSeg2) { curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT;
curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT; }
} }
} else if (mSeg == pitStart->prev) { } else if (mSeg == pitStart->prev) {
if (curSeg) { if (curSeg) {
curSeg->raceInfo |= TR_PITSTART; curSeg->raceInfo |= TR_PITSTART;
} if (curSeg2) {
if (curSeg2) { curSeg2->raceInfo |= TR_PITSTART;
curSeg2->raceInfo |= TR_PITSTART; }
} }
} else if (mSeg == pitEnd->next) { } else if (mSeg == pitEnd->next) {
if (curSeg) { if (curSeg) {
curSeg->raceInfo |= TR_PITEND; 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) { 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 }//while i
GfLogDebug("\n"); GfLogDebug("\n");
/* THIS CODE DOES NOTHING >>> */ // Setup pit speed limit
for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) { for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) {
curSeg = curSeg2 = NULL; curSeg = curSeg2 = NULL;
if ((mSeg != pitStart->prev) && (mSeg != pitEnd->next)) { switch(pits->side) {
if (curSeg) {
curSeg->raceInfo |= TR_PIT | TR_SPEEDLIMIT; case TR_RGT:
} curSeg = mSeg->rside;
if (curSeg2) { if (curSeg)
curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT; curSeg2 = curSeg->rside;
} break;
} else if (mSeg == pitStart->prev) {
if (curSeg) { case TR_LFT:
curSeg->raceInfo |= TR_PITSTART; curSeg = mSeg->lside;
} if (curSeg)
if (curSeg2) { curSeg2 = curSeg->lside;
curSeg2->raceInfo |= TR_PITSTART; break;
}
} else if (mSeg == pitEnd->next) { }
if (curSeg) {
curSeg->raceInfo |= TR_PITEND; if ((mSeg != pitStart->prev) && (mSeg != pitEnd->next)) {
} if (curSeg) {
if (curSeg2) { curSeg->raceInfo |= TR_PIT | TR_SPEEDLIMIT;
curSeg2->raceInfo |= TR_PITEND; if (curSeg2) {
} curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT;
} }
}//for mSeg }
/* <<< THIS CODE DOES NOTHING */ } 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 }//dummy
break; break;

View file

@ -1117,34 +1117,49 @@ static void AddPitDoors(tTrack *theTrack, void *TrackHandle, bool found) {
}//while i }//while i
GfLogDebug("\n"); GfLogDebug("\n");
/* THIS CODE DOES NOTHING >>> */ // Setup pit speed limit
for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) { for (mSeg = pitStart->prev; mSeg != pitEnd->next->next; mSeg = mSeg->next) {
curSeg = curSeg2 = NULL; curSeg = curSeg2 = NULL;
if ((mSeg != pitStart->prev) && (mSeg != pitEnd->next)) { switch(pits->side) {
if (curSeg) {
curSeg->raceInfo |= TR_PIT | TR_SPEEDLIMIT; case TR_RGT:
} curSeg = mSeg->rside;
if (curSeg2) { if (curSeg)
curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT; curSeg2 = curSeg->rside;
} break;
} else if (mSeg == pitStart->prev) {
if (curSeg) { case TR_LFT:
curSeg->raceInfo |= TR_PITSTART; curSeg = mSeg->lside;
} if (curSeg)
if (curSeg2) { curSeg2 = curSeg->lside;
curSeg2->raceInfo |= TR_PITSTART; break;
}
} else if (mSeg == pitEnd->next) { }
if (curSeg) {
curSeg->raceInfo |= TR_PITEND; if ((mSeg != pitStart->prev) && (mSeg != pitEnd->next)) {
} if (curSeg) {
if (curSeg2) { curSeg->raceInfo |= TR_PIT | TR_SPEEDLIMIT;
curSeg2->raceInfo |= TR_PITEND; if (curSeg2) {
} curSeg2->raceInfo |= TR_PIT | TR_SPEEDLIMIT;
} }
}//for mSeg }
/* <<< THIS CODE DOES NOTHING */ } 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 }//dummy
break; break;