diff --git a/src/interface/viewport.c b/src/interface/viewport.c index 075c85c265..6bbe90d92a 100644 --- a/src/interface/viewport.c +++ b/src/interface/viewport.c @@ -1601,9 +1601,29 @@ void viewport_track_paint_setup(uint8 direction, int height, rct_map_element *ma RCT2_GLOBAL(0x00F441A4, uint32) = ghost_id; } - TRACK_PAINT_FUNCTION **trackTypeList = (TRACK_PAINT_FUNCTION**)RideTypeTrackPaintFunctionsOld[ride->type]; + int rideType = ride->type; + if (rideType == RIDE_TYPE_JUNIOR_ROLLER_COASTER) { + switch (trackType) { + case TRACK_ELEM_60_DEG_UP: + case TRACK_ELEM_25_DEG_UP_TO_60_DEG_UP: + case TRACK_ELEM_60_DEG_UP_TO_25_DEG_UP: + case TRACK_ELEM_60_DEG_DOWN: + case TRACK_ELEM_25_DEG_DOWN_TO_60_DEG_DOWN: + case TRACK_ELEM_60_DEG_DOWN_TO_25_DEG_DOWN: + rideType = RIDE_TYPE_WATER_COASTER; + break; + + case TRACK_ELEM_FLAT_TO_60_DEG_UP: + case TRACK_ELEM_60_DEG_UP_TO_FLAT: + case TRACK_ELEM_FLAT_TO_60_DEG_DOWN: + case TRACK_ELEM_60_DEG_DOWN_TO_FLAT: + return; + } + } + + TRACK_PAINT_FUNCTION **trackTypeList = (TRACK_PAINT_FUNCTION**)RideTypeTrackPaintFunctionsOld[rideType]; if (trackTypeList == NULL) { - TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = RideTypeTrackPaintFunctions[ride->type]; + TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = RideTypeTrackPaintFunctions[rideType]; TRACK_PAINT_FUNCTION paintFunction = paintFunctionGetter(trackType, direction); if (paintFunction != NULL) { paintFunction(rideIndex, trackSequence, direction, height, mapElement); @@ -1615,7 +1635,7 @@ void viewport_track_paint_setup(uint8 direction, int height, rct_map_element *ma // Have to call from this point as it pushes esi and expects callee to pop it RCT2_CALLPROC_X( 0x006C4934, - ride->type, + rideType, (int)trackDirectionList, direction, height,