Skip to content

Commit

Permalink
Fix holding brakes being skipped
Browse files Browse the repository at this point in the history
  • Loading branch information
X123M3-256 committed Dec 30, 2024
1 parent 450f784 commit 1eecd0d
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/openrct2/ride/Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5560,15 +5560,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;
Expand Down Expand Up @@ -6929,6 +6925,12 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(
}
}

if (HasFlag(VehicleFlags::StoppedOnHoldingBrake))
{
ClearFlag(VehicleFlags::StoppedOnHoldingBrake);
}


// Change from original: this used to check if the vehicle allowed doors.
UpdateSceneryDoor();
UpdateLandscapeDoor();
Expand Down Expand Up @@ -7457,6 +7459,11 @@ bool Vehicle::UpdateTrackMotionBackwardsGetNewTrack(TrackElemType trackType, con
}
}

if (HasFlag(VehicleFlags::StoppedOnHoldingBrake))
{
ClearFlag(VehicleFlags::StoppedOnHoldingBrake);
}

trackType = tileElement->AsTrack()->GetTrackType();
if (trackType != TrackElemType::Brakes)
{
Expand Down

0 comments on commit 1eecd0d

Please sign in to comment.