mirror of https://github.com/OpenRCT2/OpenRCT2.git
Do code review suggestions
This commit is contained in:
parent
38f632074b
commit
d979511628
|
@ -1748,7 +1748,7 @@ bool rct_peep::ShouldGoOnRide(int32_t rideIndex, int32_t entranceNum, bool atQue
|
|||
// Rides without queues can only have one peep waiting at a time.
|
||||
if (!atQueue)
|
||||
{
|
||||
if (ride->stations[entranceNum].LastPeepInQueue != 0xFFFF)
|
||||
if (ride->stations[entranceNum].LastPeepInQueue != SPRITE_INDEX_NULL)
|
||||
{
|
||||
peep_tried_to_enter_full_queue(this, rideIndex);
|
||||
return false;
|
||||
|
@ -1757,7 +1757,7 @@ bool rct_peep::ShouldGoOnRide(int32_t rideIndex, int32_t entranceNum, bool atQue
|
|||
else
|
||||
{
|
||||
// Check if there's room in the queue for the peep to enter.
|
||||
if (ride->stations[entranceNum].LastPeepInQueue != 0xFFFF)
|
||||
if (ride->stations[entranceNum].LastPeepInQueue != SPRITE_INDEX_NULL)
|
||||
{
|
||||
rct_peep* lastPeepInQueue = GET_PEEP(ride->stations[entranceNum].LastPeepInQueue);
|
||||
if (abs(lastPeepInQueue->z - z) <= 6)
|
||||
|
|
|
@ -1123,7 +1123,7 @@ static void ride_remove_vehicles(Ride* ride)
|
|||
}
|
||||
|
||||
for (size_t i = 0; i < MAX_STATIONS; i++)
|
||||
ride->stations[i].TrainAtStation = 255;
|
||||
ride->stations[i].TrainAtStation = RideStation::NO_TRAIN;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5300,7 +5300,7 @@ static bool ride_create_vehicles(Ride* ride, int32_t rideIndex, CoordsXYE* eleme
|
|||
ride->lifecycle_flags |= RIDE_LIFECYCLE_ON_TRACK;
|
||||
for (int32_t i = 0; i < MAX_STATIONS; i++)
|
||||
{
|
||||
ride->stations[i].Depart = (ride->stations[i].Depart & 0x80) | 1;
|
||||
ride->stations[i].Depart = (ride->stations[i].Depart & STATION_DEPART_FLAG) | 1;
|
||||
}
|
||||
|
||||
//
|
||||
|
@ -7492,7 +7492,6 @@ static void ride_update_vehicle_colours(int32_t rideIndex)
|
|||
int32_t carIndex = 0;
|
||||
uint16_t spriteIndex = ride->vehicles[i];
|
||||
VehicleColour colours = {};
|
||||
uint8_t coloursExtended = 0;
|
||||
|
||||
while (spriteIndex != SPRITE_INDEX_NULL)
|
||||
{
|
||||
|
@ -7501,21 +7500,21 @@ static void ride_update_vehicle_colours(int32_t rideIndex)
|
|||
{
|
||||
case RIDE_COLOUR_SCHEME_ALL_SAME:
|
||||
colours = ride->vehicle_colours[0];
|
||||
coloursExtended = ride->vehicle_colours[0].Ternary;
|
||||
colours.Ternary = ride->vehicle_colours[0].Ternary;
|
||||
break;
|
||||
case RIDE_COLOUR_SCHEME_DIFFERENT_PER_TRAIN:
|
||||
colours = ride->vehicle_colours[i];
|
||||
coloursExtended = ride->vehicle_colours[i].Ternary;
|
||||
colours.Ternary = ride->vehicle_colours[i].Ternary;
|
||||
break;
|
||||
case RIDE_COLOUR_SCHEME_DIFFERENT_PER_CAR:
|
||||
colours = ride->vehicle_colours[std::min(carIndex, MAX_CARS_PER_TRAIN - 1)];
|
||||
coloursExtended = ride->vehicle_colours[std::min(carIndex, MAX_CARS_PER_TRAIN - 1)].Ternary;
|
||||
colours.Ternary = ride->vehicle_colours[std::min(carIndex, MAX_CARS_PER_TRAIN - 1)].Ternary;
|
||||
break;
|
||||
}
|
||||
|
||||
vehicle->colours.body_colour = colours.Body;
|
||||
vehicle->colours.trim_colour = colours.Trim;
|
||||
vehicle->colours_extended = coloursExtended;
|
||||
vehicle->colours_extended = colours.Ternary;
|
||||
invalidate_sprite_2((rct_sprite*)vehicle);
|
||||
spriteIndex = vehicle->next_vehicle_on_train;
|
||||
carIndex++;
|
||||
|
|
|
@ -145,11 +145,13 @@ struct RideStation
|
|||
uint8_t TrainAtStation;
|
||||
TileCoordsXYZD Entrance;
|
||||
TileCoordsXYZD Exit;
|
||||
int32_t SegmentLength;
|
||||
uint16_t SegmentTime;
|
||||
int32_t SegmentLength; // Length of track between this station and the next.
|
||||
uint16_t SegmentTime; // Time for train to reach the next station from this station.
|
||||
uint8_t QueueTime;
|
||||
uint16_t QueueLength;
|
||||
uint16_t LastPeepInQueue;
|
||||
|
||||
static constexpr uint8_t NO_TRAIN = std::numeric_limits<uint8_t>::max();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -2158,7 +2158,7 @@ static void train_ready_to_depart(rct_vehicle* vehicle, uint8_t num_peeps_on_tra
|
|||
// Boat Hire with passengers on it.
|
||||
if (ride->status != RIDE_STATUS_CLOSED || (ride->num_riders != 0 && ride->type != RIDE_TYPE_BOAT_HIRE))
|
||||
{
|
||||
ride->stations[vehicle->current_station].TrainAtStation = 0xFF;
|
||||
ride->stations[vehicle->current_station].TrainAtStation = RideStation::NO_TRAIN;
|
||||
vehicle->sub_state = 2;
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue