mirror of https://github.com/OpenRCT2/OpenRCT2.git
parent
06fbfe46ac
commit
171e255981
|
@ -1357,7 +1357,8 @@ static void window_ride_draw_tab_vehicle(rct_drawpixelinfo* dpi, rct_window* w)
|
|||
ride->subtype, ride->num_cars_per_train, rideEntry->tab_vehicle);
|
||||
rct_ride_entry_vehicle* rideVehicleEntry = &rideEntry->vehicles[vehicle];
|
||||
|
||||
vehicle_colour vehicleColour = ride_get_vehicle_colour(ride, rideEntry->tab_vehicle);
|
||||
auto vehicleId = ((ride->colour_scheme_type & 3) == VEHICLE_COLOUR_SCHEME_PER_VEHICLE) ? rideEntry->tab_vehicle : 0;
|
||||
vehicle_colour vehicleColour = ride_get_vehicle_colour(ride, vehicleId);
|
||||
int32_t spriteIndex = 32;
|
||||
if (w->page == WINDOW_RIDE_PAGE_VEHICLE)
|
||||
spriteIndex += w->frame_no;
|
||||
|
|
|
@ -3108,16 +3108,8 @@ vehicle_colour ride_get_vehicle_colour(Ride* ride, int32_t vehicleIndex)
|
|||
{
|
||||
vehicle_colour result;
|
||||
|
||||
if (ride->colour_scheme_type == VEHICLE_COLOUR_SCHEME_PER_VEHICLE)
|
||||
{
|
||||
// Prevent indexing array out of bounds
|
||||
vehicleIndex = std::min(vehicleIndex, MAX_CARS_PER_TRAIN);
|
||||
}
|
||||
else
|
||||
{
|
||||
// In this case, only the first car will be set and the rest will be either black or some residual colour.
|
||||
vehicleIndex = 0;
|
||||
}
|
||||
// Prevent indexing array out of bounds
|
||||
vehicleIndex = std::min(vehicleIndex, MAX_CARS_PER_TRAIN);
|
||||
|
||||
result.main = ride->vehicle_colours[vehicleIndex].Body;
|
||||
result.additional_1 = ride->vehicle_colours[vehicleIndex].Trim;
|
||||
|
|
Loading…
Reference in New Issue