diff --git a/src_rebuild/DebugOverlay.cpp b/src_rebuild/DebugOverlay.cpp index 754c7623..2986884e 100644 --- a/src_rebuild/DebugOverlay.cpp +++ b/src_rebuild/DebugOverlay.cpp @@ -186,12 +186,18 @@ void DrawDebugOverlays() ); PrintString(tempBuf, 10, 195); + + sprintf(tempBuf, "c %d %d %d %d", + (int)(*roadInfo.ConnectIdx)[0], (int)(*roadInfo.ConnectIdx)[1], (int)(*roadInfo.ConnectIdx)[2], (int)(*roadInfo.ConnectIdx)[3]); + + PrintString(tempBuf, 10, 205); } else if(IS_JUNCTION_SURFACE(roadInfo.surfId)) { DRIVER2_JUNCTION* junc = GET_JUNCTION(roadInfo.surfId); - sprintf(tempBuf, "JUN %d flg %d",roadInfo.surfId, junc->flags); + sprintf(tempBuf, "JUN %d flg %d - c %d %d %d %d",roadInfo.surfId, junc->flags, + (int)(*roadInfo.ConnectIdx)[0], (int)(*roadInfo.ConnectIdx)[1], (int)(*roadInfo.ConnectIdx)[2], (int)(*roadInfo.ConnectIdx)[3]); PrintString(tempBuf, 10, 180); } diff --git a/src_rebuild/Game/C/civ_ai.c b/src_rebuild/Game/C/civ_ai.c index 19b6f54f..a833c7f3 100644 --- a/src_rebuild/Game/C/civ_ai.c +++ b/src_rebuild/Game/C/civ_ai.c @@ -535,7 +535,7 @@ int GetNextRoadInfo(CAR_DATA* cp, int randomExit, int* turnAngle, int* startDist exitCnt++; } while (exitCnt < 3); - if (leftLane != rightLane && numExits != 1) + if (leftLane != rightLane && numExits != 1 && ROAD_LANES_COUNT(¤tRoadInfo) > 1) { if (cp->ai.c.currentLane == leftLane) { diff --git a/src_rebuild/Game/C/dr2roads.c b/src_rebuild/Game/C/dr2roads.c index 7511d3d7..c04ba24d 100644 --- a/src_rebuild/Game/C/dr2roads.c +++ b/src_rebuild/Game/C/dr2roads.c @@ -94,6 +94,7 @@ int GetSurfaceRoadInfo(DRIVER2_ROAD_INFO* outRoadInfo, int surfId) { DRIVER2_CURVE* curve; DRIVER2_STRAIGHT* straight; + DRIVER2_JUNCTION* junction; ClearMem((char*)outRoadInfo, sizeof(DRIVER2_ROAD_INFO)); outRoadInfo->surfId = surfId; @@ -116,6 +117,11 @@ int GetSurfaceRoadInfo(DRIVER2_ROAD_INFO* outRoadInfo, int surfId) outRoadInfo->AILanes = straight->AILanes; return 1; } + else if (IS_JUNCTION_SURFACE(surfId)) + { + junction = GET_JUNCTION(surfId); + outRoadInfo->ConnectIdx = &junction->ExitIdx; + } return 0; } @@ -166,7 +172,7 @@ void ProcessStraightsDriver2Lump(char *lump_file, int lump_size) Getlong((char *)&NumDriver2Straights, lump_file); Driver2StraightsPtr = (DRIVER2_STRAIGHT *)(lump_file + 4); - // [A] patch chicago roads + // [A] patch Chicago & Vegas roads if (GameLevel == 0 && gDisableChicagoBridges) { DRIVER2_STRAIGHT* str; @@ -196,6 +202,14 @@ void ProcessStraightsDriver2Lump(char *lump_file, int lump_size) } } } + else if (GameLevel == 2) + { + int i; + DRIVER2_STRAIGHT* str; + + Driver2StraightsPtr[348].ConnectIdx[2] = 8244; + Driver2StraightsPtr[348].ConnectIdx[3] = 351; + } } // [D] [T] @@ -233,6 +247,13 @@ void ProcessJunctionsDriver2Lump(char *lump_file, int lump_size, int fix) old++; } } + + // [A] patch Vegas roads + if (GameLevel == 2) + { + Driver2JunctionsPtr[8244 & 0x1fff].ExitIdx[1] = 348; + Driver2JunctionsPtr[8244 & 0x1fff].ExitIdx[3] = 347; + } } // [D] [T]