mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix station lights for races and normal operation rides
This commit is contained in:
parent
3e6a16ef4c
commit
112290ca0c
|
@ -89,7 +89,8 @@ static void ride_update_station_bumpercar(rct_ride *ride, int stationIndex)
|
|||
{
|
||||
int i, dx, dl, dh;
|
||||
rct_vehicle *vehicle;
|
||||
|
||||
// Change of station depart flag should really call invalidate_station_start
|
||||
// but since bumpercars do not have station lights there is no point.
|
||||
if (
|
||||
ride->status == RIDE_STATUS_CLOSED ||
|
||||
(ride->lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))
|
||||
|
@ -142,21 +143,24 @@ static void ride_update_station_normal(rct_ride *ride, int stationIndex)
|
|||
|
||||
time = ride->station_depart[stationIndex] & STATION_DEPART_MASK;
|
||||
if (
|
||||
(ride->lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) &&
|
||||
(ride->lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) ||
|
||||
(ride->status == RIDE_STATUS_CLOSED && ride->num_riders == 0)
|
||||
) {
|
||||
if (time != 0 && time != 127 && !(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) & 7))
|
||||
time--;
|
||||
|
||||
ride->station_depart[stationIndex] = time;
|
||||
ride_invalidate_station_start(ride, stationIndex, 0);
|
||||
} else {
|
||||
if (time == 0) {
|
||||
ride->station_depart[stationIndex] |= STATION_DEPART_FLAG;
|
||||
ride_invalidate_station_start(ride, stationIndex, 1);
|
||||
} else {
|
||||
if (time != 127 && !(RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_TICKS, uint32) & 31))
|
||||
time--;
|
||||
|
||||
ride->station_depart[stationIndex] = time;
|
||||
ride_invalidate_station_start(ride, stationIndex, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -175,7 +179,10 @@ static void ride_update_station_race(rct_ride *ride, int stationIndex)
|
|||
ride->status == RIDE_STATUS_CLOSED ||
|
||||
(ride->lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))
|
||||
) {
|
||||
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
|
||||
if (ride->station_depart[stationIndex] & STATION_DEPART_FLAG){
|
||||
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
|
||||
ride_invalidate_station_start(ride, stationIndex, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -193,7 +200,10 @@ static void ride_update_station_race(rct_ride *ride, int stationIndex)
|
|||
|
||||
// Race is over
|
||||
ride->lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING;
|
||||
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
|
||||
if (ride->station_depart[stationIndex] & STATION_DEPART_FLAG){
|
||||
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
|
||||
ride_invalidate_station_start(ride, stationIndex, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -205,7 +215,10 @@ static void ride_update_station_race(rct_ride *ride, int stationIndex)
|
|||
for (i = 0; i < ride->num_vehicles; i++) {
|
||||
vehicle = &(g_sprite_list[ride->vehicles[i]].vehicle);
|
||||
if (vehicle->status != VEHICLE_STATUS_WAITING_TO_DEPART && vehicle->status != VEHICLE_STATUS_DEPARTING) {
|
||||
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
|
||||
if (ride->station_depart[stationIndex] & STATION_DEPART_FLAG){
|
||||
ride->station_depart[stationIndex] &= ~STATION_DEPART_FLAG;
|
||||
ride_invalidate_station_start(ride, stationIndex, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -213,7 +226,10 @@ static void ride_update_station_race(rct_ride *ride, int stationIndex)
|
|||
// Begin the race
|
||||
ride_race_init_vehicle_speeds(ride);
|
||||
ride->lifecycle_flags |= RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING;
|
||||
ride->station_depart[stationIndex] |= STATION_DEPART_FLAG;
|
||||
if (!(ride->station_depart[stationIndex] & STATION_DEPART_FLAG)){
|
||||
ride->station_depart[stationIndex] |= STATION_DEPART_FLAG;
|
||||
ride_invalidate_station_start(ride, stationIndex, 1);
|
||||
}
|
||||
ride->window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue