Use Is/Set BlockBrakeClosed

This commit is contained in:
duncanspumpkin 2019-02-26 09:40:24 +00:00
parent 92cdbfb0a8
commit 83f7547bf2
4 changed files with 11 additions and 11 deletions

View File

@ -4530,7 +4530,7 @@ static void ride_set_block_points(CoordsXYE* startElement)
case TRACK_ELEM_DIAG_25_DEG_UP_TO_FLAT:
case TRACK_ELEM_DIAG_60_DEG_UP_TO_FLAT:
case TRACK_ELEM_BLOCK_BRAKES:
currentElement.element->flags &= ~TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED;
currentElement.element->AsTrack()->SetBlockBrakeClosed(false);
break;
}
} while (track_block_get_next(&currentElement, &currentElement, nullptr, nullptr)
@ -5076,7 +5076,7 @@ void loc_6DDF9C(Ride* ride, TileElement* tileElement)
do
{
tileElement->flags |= TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED;
tileElement->AsTrack()->SetBlockBrakeClosed(true);
car = train;
while (true)
{
@ -5094,7 +5094,7 @@ void loc_6DDF9C(Ride* ride, TileElement* tileElement)
}
} while (!(vehicle_update_track_motion(train, nullptr) & VEHICLE_UPDATE_MOTION_TRACK_FLAG_10));
tileElement->flags |= TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED;
tileElement->AsTrack()->SetBlockBrakeClosed(true);
car = train;
while (true)
{

View File

@ -57,7 +57,7 @@ static void ride_update_station_blocksection(Ride* ride, int32_t stationIndex)
TileElement* tileElement = ride_get_station_start_track_element(ride, stationIndex);
if ((ride->status == RIDE_STATUS_CLOSED && ride->num_riders == 0)
|| (tileElement != nullptr && tileElement->flags & TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED))
|| (tileElement != nullptr && tileElement->AsTrack()->BlockBrakeClosed()))
{
ride->stations[stationIndex].Depart &= ~STATION_DEPART_FLAG;

View File

@ -6670,13 +6670,13 @@ static void check_and_apply_block_section_stop_site(rct_vehicle* vehicle)
{
case TRACK_ELEM_BLOCK_BRAKES:
if (ride_is_block_sectioned(ride))
apply_block_brakes(vehicle, trackElement->flags & TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED);
apply_block_brakes(vehicle, trackElement->AsTrack()->BlockBrakeClosed());
else
apply_non_stop_block_brake(vehicle, true);
break;
case TRACK_ELEM_END_STATION:
if (trackElement->flags & TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED)
if (trackElement->AsTrack()->BlockBrakeClosed())
_vehicleMotionTrackFlags |= VEHICLE_UPDATE_MOTION_TRACK_FLAG_10;
break;
@ -6689,7 +6689,7 @@ static void check_and_apply_block_section_stop_site(rct_vehicle* vehicle)
{
if (trackType == TRACK_ELEM_CABLE_LIFT_HILL || trackElement->AsTrack()->HasChain())
{
if (trackElement->flags & TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED)
if (trackElement->AsTrack()->BlockBrakeClosed())
{
apply_block_brakes(vehicle, true);
}
@ -6781,7 +6781,7 @@ static void vehicle_update_block_brakes_open_previous_section(rct_vehicle* vehic
{
return;
}
tileElement->flags &= ~TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED;
tileElement->AsTrack()->SetBlockBrakeClosed(false);
map_invalidate_element(x, y, tileElement);
int32_t trackType = tileElement->AsTrack()->GetTrackType();
@ -7967,7 +7967,7 @@ static bool vehicle_update_track_motion_forwards_get_new_track(
{
if (vehicle->next_vehicle_on_train == SPRITE_INDEX_NULL)
{
tileElement->flags |= TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED;
tileElement->AsTrack()->SetBlockBrakeClosed(true);
if (trackType == TRACK_ELEM_BLOCK_BRAKES || trackType == TRACK_ELEM_END_STATION)
{
if (!(rideEntry->vehicles[0].flags & VEHICLE_ENTRY_FLAG_POWERED))

View File

@ -1646,7 +1646,7 @@ void junior_rc_paint_station(
{
uint32_t imageId;
bool isBraked = (bool)(tileElement->flags & TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED);
bool isBraked = tileElement->AsTrack()->BlockBrakeClosed();
if (direction == 0 || direction == 2)
{
@ -3693,7 +3693,7 @@ static void junior_rc_block_brake_paint_setup(
{
uint32_t image_id;
bool isBraked = (bool)(tileElement->flags & TILE_ELEMENT_FLAG_BLOCK_BRAKE_CLOSED);
bool isBraked = tileElement->AsTrack()->BlockBrakeClosed();
image_id = junior_rc_track_pieces_block_brake[isBraked][direction] | session->TrackColours[SCHEME_TRACK];
if (direction & 1)