mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-25 03:42:34 +01:00
- fix crash and simplify code
This commit is contained in:
parent
90caa8cb70
commit
e243cefe87
@ -718,22 +718,7 @@ int GetNextRoadInfo(CAR_DATA* cp, int randomExit, int* turnAngle, int* startDist
|
||||
// [A] fix lane changingg issues
|
||||
if(cp->ai.c.changeLaneCount > 0)
|
||||
{
|
||||
int distAlongPath;
|
||||
if (roadInfo.straight)
|
||||
{
|
||||
if (ROAD_LANE_DIR(&roadInfo, newLane))
|
||||
distAlongPath = roadInfo.straight->length;
|
||||
else
|
||||
distAlongPath = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ROAD_LANE_DIR(&roadInfo, newLane))
|
||||
distAlongPath = roadInfo.curve->end - roadInfo.curve->start & 0xfff;
|
||||
else
|
||||
distAlongPath = 0;
|
||||
}
|
||||
GetNodePos(currentRoadInfo.straight, NULL, currentRoadInfo.curve, distAlongPath, NULL, &px, &pz, cp->ai.c.currentLane);
|
||||
GetNodePos(currentRoadInfo.straight, NULL, currentRoadInfo.curve, oldNode->distAlongSegment, NULL, &px, &pz, cp->ai.c.currentLane);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user