mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #11648 from Gymnasiast/block-brake-constant
Create constant for BLOCK_BRAKE_BASE_SPEED
This commit is contained in:
commit
6b591c6c75
|
@ -15,6 +15,8 @@
|
|||
|
||||
constexpr const uint16_t RideConstructionSpecialPieceSelected = 0x100;
|
||||
|
||||
constexpr const int32_t BLOCK_BRAKE_BASE_SPEED = 0x20364;
|
||||
|
||||
using track_type_t = uint16_t;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
|
|
@ -6621,18 +6621,18 @@ void Vehicle::UpdateTrackMotionUpStopCheck() const
|
|||
* merely as a velocity regulator, in a closed state. When the brake is open, it
|
||||
* boosts the train to the speed limit
|
||||
*/
|
||||
static void apply_non_stop_block_brake(Vehicle* vehicle, bool block_brake_closed)
|
||||
static void apply_non_stop_block_brake(Vehicle* vehicle, bool slowDownToBlockBrakeSpeed)
|
||||
{
|
||||
if (vehicle->velocity >= 0)
|
||||
{
|
||||
// If the vehicle is below the speed limit
|
||||
if (vehicle->velocity <= 0x20364)
|
||||
if (vehicle->velocity <= BLOCK_BRAKE_BASE_SPEED)
|
||||
{
|
||||
// Boost it to the fixed block brake speed
|
||||
vehicle->velocity = 0x20364;
|
||||
vehicle->velocity = BLOCK_BRAKE_BASE_SPEED;
|
||||
vehicle->acceleration = 0;
|
||||
}
|
||||
else if (block_brake_closed)
|
||||
else if (slowDownToBlockBrakeSpeed)
|
||||
{
|
||||
// Slow it down till the fixed block brake speed
|
||||
vehicle->velocity -= vehicle->velocity >> 4;
|
||||
|
@ -7587,7 +7587,7 @@ static void vehicle_update_handle_scenery_door(Vehicle* vehicle)
|
|||
|
||||
static void vehicle_update_play_water_splash_sound()
|
||||
{
|
||||
if (_vehicleVelocityF64E08 <= 0x20364)
|
||||
if (_vehicleVelocityF64E08 <= BLOCK_BRAKE_BASE_SPEED)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue