Skip to content

Commit

Permalink
use updated field names
Browse files Browse the repository at this point in the history
  • Loading branch information
spacek531 committed Jun 4, 2024
1 parent 41cd2c0 commit ccb5737
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/openrct2-ui/windows/RideConstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
#include <openrct2/world/Footpath.h>
#include <openrct2/world/Park.h>

constexpr int8_t kDefaultSpeedIncrement = 2;
constexpr int8_t kDefaultMinimumSpeed = 2;
constexpr int8_t kDefaultSpeedIncrement = 1;
constexpr int8_t kDefaultMinimumSpeed = 1;

using namespace OpenRCT2::TrackMetaData;
namespace OpenRCT2::Ui::Windows
Expand Down
7 changes: 3 additions & 4 deletions src/openrct2/park/ParkFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2123,14 +2123,14 @@ namespace OpenRCT2
auto rtd = entity.GetRide()->GetRideTypeDescriptor();
if (trackType == TrackElemType::Booster)
{
entity.BoosterAcceleration = rtd.OperatingSettings.BoosterAcceleration;
entity.BoosterAcceleration = rtd.LegacyBoosterSettings.BoosterAcceleration;
brakeSpeed = rtd.GetAbsoluteBoosterSpeed(brakeSpeed);
}
else if (
(trackType == TrackElemType::PoweredLift)
|| (trackType == TrackElemType::Flat && entity.GetRide()->type == RIDE_TYPE_REVERSE_FREEFALL_COASTER))
|| (trackType == TrackElemType::Flat && rtd.HasFlag(RIDE_TYPE_FLAG_LSM_BEHAVIOUR_ON_FLAT)))
{
entity.BoosterAcceleration = rtd.OperatingSettings.PoweredLiftAcceleration;
entity.BoosterAcceleration = rtd.BoosterSettings.PoweredLiftAcceleration;
entity.SetFlag(VehicleFlags::OnPoweredLift);
}
entity.brake_speed = brakeSpeed * kLegacyBrakeSpeedMultiplier;
Expand Down Expand Up @@ -2166,7 +2166,6 @@ namespace OpenRCT2
entity.SetFlag(VehicleFlags::Crashed);
}
}

if (cs.GetMode() == OrcaStream::Mode::READING && os.GetHeader().TargetVersion < BlockBrakeImprovementsVersion)
{
entity.BlockBrakeSpeed = kRCT2DefaultBlockBrakeSpeed;
Expand Down
7 changes: 4 additions & 3 deletions src/openrct2/rct1/S4Importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2925,17 +2925,18 @@ namespace RCT1
dst->BlockBrakeSpeed = kRCT2DefaultBlockBrakeSpeed;
dst->Flags = src->UpdateFlags;

auto rtd = dst->GetRide()->GetRideTypeDescriptor();
dst->SetFlag(VehicleFlags::LegacyBoosterSpeed);
if ((dst->GetTrackType() == TrackElemType::PoweredLift)
|| (dst->GetTrackType() == TrackElemType::Flat && ride->type == RIDE_TYPE_REVERSE_FREEFALL_COASTER))
|| (dst->GetTrackType() == TrackElemType::Flat && rtd.HasFlag(RIDE_TYPE_FLAG_LSM_BEHAVIOUR_ON_FLAT)))
{
dst->BoosterAcceleration = ride->GetRideTypeDescriptor().OperatingSettings.PoweredLiftAcceleration;
dst->BoosterAcceleration = ride->GetRideTypeDescriptor().BoosterSettings.PoweredLiftAcceleration;
dst->SetFlag(VehicleFlags::OnPoweredLift);
}
else if (dst->GetTrackType() == TrackElemType::Booster)
{
dst->brake_speed = ride->GetRideTypeDescriptor().GetAbsoluteBoosterSpeed(dst->brake_speed);
dst->BoosterAcceleration = ride->GetRideTypeDescriptor().OperatingSettings.BoosterAcceleration;
dst->BoosterAcceleration = ride->GetRideTypeDescriptor().LegacyBoosterSettings.BoosterAcceleration;
}
dst->track_progress = src->TrackProgress;
dst->vertical_drop_countdown = src->VerticalDropCountdown;
Expand Down
7 changes: 4 additions & 3 deletions src/openrct2/rct2/S6Importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2595,17 +2595,18 @@ namespace RCT2

dst->brake_speed = src->BrakeSpeed * kLegacyBrakeSpeedMultiplier;

auto rtd = GetRideTypeDescriptor(ride.Type);
dst->SetFlag(VehicleFlags::LegacyBoosterSpeed);
if ((dst->GetTrackType() == TrackElemType::PoweredLift)
|| (dst->GetTrackType() == TrackElemType::Flat && ride.Type == RIDE_TYPE_REVERSE_FREEFALL_COASTER))
|| (dst->GetTrackType() == TrackElemType::Flat && rtd.HasFlag(RIDE_TYPE_FLAG_LSM_BEHAVIOUR_ON_FLAT)))
{
dst->BoosterAcceleration = GetRideTypeDescriptor(ride.Type).OperatingSettings.PoweredLiftAcceleration;
dst->BoosterAcceleration = GetRideTypeDescriptor(ride.Type).BoosterSettings.PoweredLiftAcceleration;
dst->SetFlag(VehicleFlags::OnPoweredLift);
}
else if (dst->GetTrackType() == TrackElemType::Booster)
{
dst->brake_speed = GetRideTypeDescriptor(ride.Type).GetAbsoluteBoosterSpeed(dst->brake_speed);
dst->BoosterAcceleration = GetRideTypeDescriptor(ride.Type).OperatingSettings.BoosterAcceleration;
dst->BoosterAcceleration = GetRideTypeDescriptor(ride.Type).LegacyBoosterSettings.BoosterAcceleration;
}

dst->lost_time_out = src->LostTimeOut;
Expand Down

0 comments on commit ccb5737

Please sign in to comment.