1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

rename SetBrakeClosed2 to SetBrakeClosedMultiTile

This commit is contained in:
Spacek531
2023-09-23 12:46:38 -07:00
parent 3676b47a20
commit b44e522262
4 changed files with 24 additions and 24 deletions

View File

@@ -3048,6 +3048,24 @@ static void RideSetMazeEntranceExitPoints(Ride& ride)
}
}
void SetBrakeClosedMultiTile(TrackElement& trackElement, const CoordsXY& trackLocation, bool isClosed)
{
switch (trackElement.GetTrackType())
{
case TrackElemType::DiagUp25ToFlat:
case TrackElemType::DiagUp60ToFlat:
case TrackElemType::CableLiftHill:
case TrackElemType::DiagBrakes:
case TrackElemType::DiagBlockBrakes:
GetTrackElementOriginAndApplyChanges(
{ trackLocation, trackElement.GetBaseZ(), trackElement.GetDirection() }, trackElement.GetTrackType(), isClosed,
nullptr, TRACK_ELEMENT_SET_BRAKE_CLOSED_STATE);
break;
default:
trackElement.SetBrakeClosed(isClosed);
}
}
/**
* Opens all block brakes of a ride.
* rct2: 0x006B4E6B
@@ -3072,7 +3090,7 @@ static void RideOpenBlockBrakes(const CoordsXYE& startElement)
case TrackElemType::EndStation:
case TrackElemType::Up25ToFlat:
case TrackElemType::Up60ToFlat:
SetBrakeClosed2(*currentElement.element->AsTrack(), { currentElement.x, currentElement.y }, false);
SetBrakeClosedMultiTile(*currentElement.element->AsTrack(), { currentElement.x, currentElement.y }, false);
break;
}
} while (TrackBlockGetNext(&currentElement, &currentElement, nullptr, nullptr)
@@ -3111,7 +3129,7 @@ void BlockBrakeSetLinkedBrakesClosed(const CoordsXYZ& vehicleTrackLocation, Trac
if (TrackTypeIsBrakes(tileElement->AsTrack()->GetTrackType()))
{
SetBrakeClosed2(
SetBrakeClosedMultiTile(
*tileElement->AsTrack(), { trackBeginEnd.begin_x, trackBeginEnd.begin_y },
(tileElement->AsTrack()->GetBrakeBoosterSpeed() >= brakeSpeed) || isClosed);
}
@@ -3694,7 +3712,7 @@ void Ride::MoveTrainsToBlockBrakes(const CoordsXYZ& firstBlockPosition, TrackEle
// All vehicles are in position, set the block brake directly before the station one last time and make sure the brakes
// are set appropriately
SetBrakeClosed2(firstBlock, firstBlockPosition, true);
SetBrakeClosedMultiTile(firstBlock, firstBlockPosition, true);
if (TrackTypeIsBlockBrakes(firstBlock.GetTrackType()))
{
BlockBrakeSetLinkedBrakesClosed(firstBlockPosition, firstBlock, true);

View File

@@ -1109,7 +1109,7 @@ int32_t RideGetEntryIndex(int32_t rideType, int32_t rideSubType);
void DetermineRideEntranceAndExitLocations();
void RideClearLeftoverEntrances(const Ride& ride);
void SetBrakeClosed2(TrackElement& trackElement, const CoordsXY& trackLocation, bool isClosed);
void SetBrakeClosedMultiTile(TrackElement& trackElement, const CoordsXY& trackLocation, bool isClosed);
std::vector<RideId> GetTracklessRides();

View File

@@ -564,24 +564,6 @@ bool TrackElement::IsBlockStart() const
return false;
}
void SetBrakeClosed2(TrackElement& trackElement, const CoordsXY& trackLocation, bool isClosed)
{
switch (trackElement.GetTrackType())
{
case TrackElemType::DiagUp25ToFlat:
case TrackElemType::DiagUp60ToFlat:
case TrackElemType::CableLiftHill:
case TrackElemType::DiagBrakes:
case TrackElemType::DiagBlockBrakes:
GetTrackElementOriginAndApplyChanges(
{ trackLocation, trackElement.GetBaseZ(), trackElement.GetDirection() }, trackElement.GetTrackType(), isClosed,
nullptr, TRACK_ELEMENT_SET_BRAKE_CLOSED_STATE);
break;
default:
trackElement.SetBrakeClosed(isClosed);
}
}
roll_type_t TrackGetActualBank(TileElement* tileElement, roll_type_t bank)
{
auto ride = GetRide(tileElement->AsTrack()->GetRideIndex());

View File

@@ -6192,7 +6192,7 @@ static void block_brakes_open_previous_section(
return;
}
auto trackElement = trackOrigin->AsTrack();
SetBrakeClosed2(*trackElement, location, false);
SetBrakeClosedMultiTile(*trackElement, location, false);
MapInvalidateElement(location, reinterpret_cast<TileElement*>(trackElement));
auto trackType = trackElement->GetTrackType();
@@ -7473,7 +7473,7 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(uint16_t trackType, const Rid
{
if (next_vehicle_on_train.IsNull())
{
SetBrakeClosed2(*tileElement->AsTrack(), TrackLocation, true);
SetBrakeClosedMultiTile(*tileElement->AsTrack(), TrackLocation, true);
if (TrackTypeIsBlockBrakes(trackType) || trackType == TrackElemType::EndStation)
{
if (!(rideEntry.Cars[0].flags & CAR_ENTRY_FLAG_POWERED))