Fix holding brakes being skipped if they're too close together

This commit is contained in:
X123M3-256 2025-01-15 12:54:27 +00:00 committed by GitHub
parent 864d9b2d73
commit a935084e55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 8 deletions

View file

@ -9,6 +9,7 @@
- Fix: [#21794] Lay-down coaster cars reverse on first frames of downwards corkscrew.
- Fix: [#23368] Incorrect refund amount when deleting track pieces at or above 96m.
- Fix: [#23508] Simultaneous virtual floors shown for ride and footpath.
- Fix: [#23512] Holding brakes are skipped if theyre too close together.
- Fix: [#23581] [Plugin] Food/drink items given to guests have no consumption duration set.
- Fix: [#23591] “Install new track” button in Track Designs Manager is misaligned.
- Fix: [#23618] Can no longer build diagonal brakes & block brakes on Steeplechase, Inverted Lay-down, & Inverted Multi-Dim roller coasters.

View file

@ -50,7 +50,7 @@ using namespace OpenRCT2;
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
constexpr uint8_t kNetworkStreamVersion = 2;
constexpr uint8_t kNetworkStreamVersion = 3;
const std::string kNetworkStreamID = std::string(OPENRCT2_VERSION) + "-" + std::to_string(kNetworkStreamVersion);

View file

@ -5564,15 +5564,11 @@ void Vehicle::UpdateVelocity()
}
if (HasFlag(VehicleFlags::StoppedOnHoldingBrake))
{
vertical_drop_countdown--;
if (vertical_drop_countdown == -70)
{
ClearFlag(VehicleFlags::StoppedOnHoldingBrake);
}
if (vertical_drop_countdown >= 0)
if (vertical_drop_countdown > 0)
{
nextVelocity = 0;
acceleration = 0;
vertical_drop_countdown--;
}
}
velocity = nextVelocity;
@ -7060,6 +7056,10 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(
SetTrackDirection(location.direction);
SetTrackType(trackType);
PopulateBrakeSpeed(TrackLocation, *tileElement->AsTrack());
if (HasFlag(VehicleFlags::StoppedOnHoldingBrake) && vertical_drop_countdown <= 0)
{
ClearFlag(VehicleFlags::StoppedOnHoldingBrake);
}
if (trackType == TrackElemType::OnRidePhoto)
{
trigger_on_ride_photo(TrackLocation, tileElement);
@ -7470,7 +7470,10 @@ bool Vehicle::UpdateTrackMotionBackwardsGetNewTrack(TrackElemType trackType, con
SetTrackType(trackType);
SetTrackDirection(direction);
PopulateBrakeSpeed(TrackLocation, *tileElement->AsTrack());
if (HasFlag(VehicleFlags::StoppedOnHoldingBrake) && vertical_drop_countdown <= 0)
{
ClearFlag(VehicleFlags::StoppedOnHoldingBrake);
}
// There are two bytes before the move info list
uint16_t trackTotalProgress = GetTrackProgress();
*progress = trackTotalProgress - 1;