mirror of https://github.com/OpenRCT2/OpenRCT2.git
Replace RideTypeDescriptors[ride->type] with GetRideTypeDescriptor()
This commit is contained in:
parent
56399e7188
commit
d63e3b1d9f
|
@ -1515,7 +1515,7 @@ static uint16_t map_window_get_pixel_colour_ride(const CoordsXY& c)
|
|||
ride = get_ride(tileElement->AsEntrance()->GetRideIndex());
|
||||
if (ride != nullptr)
|
||||
{
|
||||
const auto& colourKey = RideTypeDescriptors[ride->type].ColourKey;
|
||||
const auto& colourKey = ride->GetRideTypeDescriptor().ColourKey;
|
||||
colourA = RideKeyColours[static_cast<size_t>(colourKey)];
|
||||
}
|
||||
break;
|
||||
|
@ -1523,7 +1523,7 @@ static uint16_t map_window_get_pixel_colour_ride(const CoordsXY& c)
|
|||
ride = get_ride(tileElement->AsTrack()->GetRideIndex());
|
||||
if (ride != nullptr)
|
||||
{
|
||||
const auto& colourKey = RideTypeDescriptors[ride->type].ColourKey;
|
||||
const auto& colourKey = ride->GetRideTypeDescriptor().ColourKey;
|
||||
colourA = RideKeyColours[static_cast<size_t>(colourKey)];
|
||||
}
|
||||
|
||||
|
|
|
@ -2423,7 +2423,7 @@ static void window_ride_main_invalidate(rct_window* w)
|
|||
else
|
||||
{
|
||||
window_ride_main_widgets[WIDX_RIDE_TYPE].type = WindowWidgetType::DropdownMenu;
|
||||
window_ride_main_widgets[WIDX_RIDE_TYPE].text = RideTypeDescriptors[ride->type].Naming.Name;
|
||||
window_ride_main_widgets[WIDX_RIDE_TYPE].text = ride->GetRideTypeDescriptor().Naming.Name;
|
||||
window_ride_main_widgets[WIDX_RIDE_TYPE_DROPDOWN].type = WindowWidgetType::Button;
|
||||
}
|
||||
|
||||
|
@ -2523,7 +2523,7 @@ static rct_string_id window_ride_get_status_vehicle(rct_window* w, Formatter& ft
|
|||
|| trackType == TrackElemType::Up25ToFlat || trackType == TrackElemType::Up60ToFlat
|
||||
|| trackType == TrackElemType::DiagUp25ToFlat || trackType == TrackElemType::DiagUp60ToFlat)
|
||||
{
|
||||
if (RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_BLOCK_BRAKES) && vehicle->velocity == 0)
|
||||
if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_BLOCK_BRAKES) && vehicle->velocity == 0)
|
||||
{
|
||||
ft.Add<rct_string_id>(STR_STOPPED_BY_BLOCK_BRAKES);
|
||||
return STR_BLACK_STRING;
|
||||
|
@ -2535,7 +2535,7 @@ static rct_string_id window_ride_get_status_vehicle(rct_window* w, Formatter& ft
|
|||
return STR_EMPTY;
|
||||
|
||||
auto stringId = VehicleStatusNames[static_cast<size_t>(vehicle->status)];
|
||||
if ((RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_SINGLE_SESSION)
|
||||
if ((ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_SINGLE_SESSION)
|
||||
&& vehicle->status <= Vehicle::Status::UnloadingPassengers)
|
||||
{
|
||||
stringId = SingleSessionVehicleStatusNames[static_cast<size_t>(vehicle->status)];
|
||||
|
@ -2544,7 +2544,7 @@ static rct_string_id window_ride_get_status_vehicle(rct_window* w, Formatter& ft
|
|||
ft.Add<rct_string_id>(stringId);
|
||||
uint16_t speedInMph = (abs(vehicle->velocity) * 9) >> 18;
|
||||
ft.Add<uint16_t>(speedInMph);
|
||||
const RideComponentName stationName = GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.station);
|
||||
const RideComponentName stationName = GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station);
|
||||
ft.Add<rct_string_id>(ride->num_stations > 1 ? stationName.number : stationName.singular);
|
||||
ft.Add<uint16_t>(vehicle->current_station + 1);
|
||||
return stringId != STR_CRASHING && stringId != STR_CRASHED_0 ? STR_BLACK_STRING : STR_RED_OUTLINED_STRING;
|
||||
|
@ -2651,12 +2651,12 @@ static void window_ride_main_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
{
|
||||
if (w->ride.view > ride->num_vehicles)
|
||||
{
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.station).number);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).number);
|
||||
ft.Add<uint16_t>(w->ride.view - ride->num_vehicles);
|
||||
}
|
||||
else
|
||||
{
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).number);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number);
|
||||
ft.Add<uint16_t>(w->ride.view);
|
||||
}
|
||||
}
|
||||
|
@ -2805,7 +2805,7 @@ static OpenRCT2String window_ride_vehicle_tooltip(
|
|||
auto ft = Formatter();
|
||||
ft.Increment(12);
|
||||
|
||||
RideComponentType vehicleType = RideTypeDescriptors[ride->type].NameConvention.vehicle;
|
||||
RideComponentType vehicleType = ride->GetRideTypeDescriptor().NameConvention.vehicle;
|
||||
rct_string_id stringId = GetRideComponentName(vehicleType).count;
|
||||
if (ride->max_trains > 1)
|
||||
{
|
||||
|
@ -2904,7 +2904,7 @@ static void window_ride_vehicle_invalidate(rct_window* w)
|
|||
auto ft = Formatter::Common();
|
||||
ft.Increment(6);
|
||||
ft.Add<uint16_t>(carsPerTrain);
|
||||
RideComponentType vehicleType = RideTypeDescriptors[ride->type].NameConvention.vehicle;
|
||||
RideComponentType vehicleType = ride->GetRideTypeDescriptor().NameConvention.vehicle;
|
||||
stringId = GetRideComponentName(vehicleType).count;
|
||||
if (ride->num_vehicles > 1)
|
||||
{
|
||||
|
@ -3103,7 +3103,7 @@ static void window_ride_mode_tweak_increase(rct_window* w)
|
|||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
const auto& operatingSettings = RideTypeDescriptors[ride->type].OperatingSettings;
|
||||
const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings;
|
||||
uint8_t maxValue = operatingSettings.MaxValue;
|
||||
uint8_t minValue = gCheatsFastLiftHill ? 0 : operatingSettings.MinValue;
|
||||
|
||||
|
@ -3128,7 +3128,7 @@ static void window_ride_mode_tweak_decrease(rct_window* w)
|
|||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
const auto& operatingSettings = RideTypeDescriptors[ride->type].OperatingSettings;
|
||||
const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings;
|
||||
uint8_t maxValue = operatingSettings.MaxValue;
|
||||
uint8_t minValue = gCheatsFastLiftHill ? 0 : operatingSettings.MinValue;
|
||||
if (gCheatsFastLiftHill)
|
||||
|
@ -3285,15 +3285,15 @@ static void window_ride_operating_mousedown(rct_window* w, rct_widgetindex widge
|
|||
window_ride_mode_tweak_decrease(w);
|
||||
break;
|
||||
case WIDX_LIFT_HILL_SPEED_INCREASE:
|
||||
upper_bound = gCheatsFastLiftHill ? 255 : RideTypeDescriptors[ride->type].LiftData.maximum_speed;
|
||||
lower_bound = gCheatsFastLiftHill ? 0 : RideTypeDescriptors[ride->type].LiftData.minimum_speed;
|
||||
upper_bound = gCheatsFastLiftHill ? 255 : ride->GetRideTypeDescriptor().LiftData.maximum_speed;
|
||||
lower_bound = gCheatsFastLiftHill ? 0 : ride->GetRideTypeDescriptor().LiftData.minimum_speed;
|
||||
set_operating_setting(
|
||||
w->number, RideSetSetting::LiftHillSpeed,
|
||||
std::clamp<int16_t>(ride->lift_hill_speed + 1, lower_bound, upper_bound));
|
||||
break;
|
||||
case WIDX_LIFT_HILL_SPEED_DECREASE:
|
||||
upper_bound = gCheatsFastLiftHill ? 255 : RideTypeDescriptors[ride->type].LiftData.maximum_speed;
|
||||
lower_bound = gCheatsFastLiftHill ? 0 : RideTypeDescriptors[ride->type].LiftData.minimum_speed;
|
||||
upper_bound = gCheatsFastLiftHill ? 255 : ride->GetRideTypeDescriptor().LiftData.maximum_speed;
|
||||
lower_bound = gCheatsFastLiftHill ? 0 : ride->GetRideTypeDescriptor().LiftData.minimum_speed;
|
||||
set_operating_setting(
|
||||
w->number, RideSetSetting::LiftHillSpeed,
|
||||
std::clamp<int16_t>(ride->lift_hill_speed - 1, lower_bound, upper_bound));
|
||||
|
@ -3440,10 +3440,10 @@ static void window_ride_operating_invalidate(rct_window* w)
|
|||
| (1ULL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX));
|
||||
|
||||
// Sometimes, only one of the alternatives support lift hill pieces. Make sure to check both.
|
||||
bool hasAlternativeType = RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE);
|
||||
if (RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_LIFT_HILL)
|
||||
bool hasAlternativeType = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE);
|
||||
if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_LIFT_HILL)
|
||||
|| (hasAlternativeType
|
||||
&& RideTypeDescriptors[RideTypeDescriptors[ride->type].AlternateType].SupportsTrackPiece(TRACK_LIFT_HILL)))
|
||||
&& RideTypeDescriptors[ride->GetRideTypeDescriptor().AlternateType].SupportsTrackPiece(TRACK_LIFT_HILL)))
|
||||
{
|
||||
window_ride_operating_widgets[WIDX_LIFT_HILL_SPEED_LABEL].type = WindowWidgetType::Label;
|
||||
window_ride_operating_widgets[WIDX_LIFT_HILL_SPEED].type = WindowWidgetType::Spinner;
|
||||
|
@ -3487,7 +3487,7 @@ static void window_ride_operating_invalidate(rct_window* w)
|
|||
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].type = WindowWidgetType::Checkbox;
|
||||
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].tooltip
|
||||
= STR_LEAVE_IF_ANOTHER_VEHICLE_ARRIVES_TIP;
|
||||
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].text = RideTypeDescriptors[ride->type]
|
||||
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].text = ride->GetRideTypeDescriptor()
|
||||
.NameConvention.vehicle
|
||||
== RideComponentType::Boat
|
||||
? STR_LEAVE_IF_ANOTHER_BOAT_ARRIVES
|
||||
|
@ -4043,7 +4043,7 @@ static void window_ride_maintenance_invalidate(rct_window* w)
|
|||
window_ride_maintenance_widgets[WIDX_FORCE_BREAKDOWN].type = WindowWidgetType::Empty;
|
||||
}
|
||||
|
||||
if (RideTypeDescriptors[ride->type].AvailableBreakdowns == 0 || !(ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED))
|
||||
if (ride->GetRideTypeDescriptor().AvailableBreakdowns == 0 || !(ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED))
|
||||
{
|
||||
w->disabled_widgets |= (1 << WIDX_REFURBISH_RIDE);
|
||||
window_ride_maintenance_widgets[WIDX_REFURBISH_RIDE].tooltip = STR_CANT_REFURBISH_NOT_NEEDED;
|
||||
|
@ -4370,7 +4370,7 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn
|
|||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL;
|
||||
gDropdownItemsArgs[i] = (GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).singular
|
||||
gDropdownItemsArgs[i] = (GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).singular
|
||||
<< 16)
|
||||
| VehicleColourSchemeNames[i];
|
||||
}
|
||||
|
@ -4393,7 +4393,7 @@ static void window_ride_colour_mousedown(rct_window* w, rct_widgetindex widgetIn
|
|||
{
|
||||
gDropdownItemsFormat[i] = STR_DROPDOWN_MENU_LABEL;
|
||||
gDropdownItemsArgs[i] = (static_cast<int64_t>(i + 1) << 32)
|
||||
| ((GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).capitalised) << 16)
|
||||
| ((GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised) << 16)
|
||||
| stringId;
|
||||
}
|
||||
|
||||
|
@ -4655,7 +4655,7 @@ static void window_ride_colour_invalidate(rct_window* w)
|
|||
window_ride_colour_widgets[WIDX_TRACK_PREVIEW].type = WindowWidgetType::Empty;
|
||||
|
||||
// Entrance style
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT)
|
||||
if (ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT)
|
||||
{
|
||||
window_ride_colour_widgets[WIDX_ENTRANCE_PREVIEW].type = WindowWidgetType::Spinner;
|
||||
window_ride_colour_widgets[WIDX_ENTRANCE_STYLE].type = WindowWidgetType::DropdownMenu;
|
||||
|
@ -4745,8 +4745,8 @@ static void window_ride_colour_invalidate(rct_window* w)
|
|||
ft.Rewind();
|
||||
ft.Increment(6);
|
||||
ft.Add<rct_string_id>(VehicleColourSchemeNames[vehicleColourSchemeType]);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).capitalised);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised);
|
||||
ft.Add<uint16_t>(w->vehicleIndex + 1);
|
||||
|
||||
// Vehicle index
|
||||
|
@ -5959,7 +5959,7 @@ static OpenRCT2String window_ride_graphs_tooltip(rct_window* w, const rct_widget
|
|||
{
|
||||
auto ft = Formatter();
|
||||
ft.Increment(2);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.vehicle).number);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number);
|
||||
ft.Add<uint16_t>(measurement->vehicle_index + 1);
|
||||
return { fallback, ft };
|
||||
}
|
||||
|
@ -6291,7 +6291,7 @@ static void window_ride_income_toggle_secondary_price(rct_window* w)
|
|||
|
||||
auto shop_item = rideEntry->shop_item[1];
|
||||
if (shop_item == ShopItem::None)
|
||||
shop_item = RideTypeDescriptors[ride->type].PhotoItem;
|
||||
shop_item = ride->GetRideTypeDescriptor().PhotoItem;
|
||||
|
||||
update_same_price_throughout_flags(shop_item);
|
||||
|
||||
|
@ -6597,7 +6597,7 @@ static void window_ride_income_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Get secondary item
|
||||
auto secondaryItem = RideTypeDescriptors[ride->type].PhotoItem;
|
||||
auto secondaryItem = ride->GetRideTypeDescriptor().PhotoItem;
|
||||
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO))
|
||||
{
|
||||
if ((secondaryItem = rideEntry->shop_item[1]) != ShopItem::None)
|
||||
|
@ -6685,7 +6685,7 @@ static void window_ride_income_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
screenCoords.y += 44;
|
||||
|
||||
// Secondary item profit / loss per item sold
|
||||
secondaryItem = RideTypeDescriptors[ride->type].PhotoItem;
|
||||
secondaryItem = ride->GetRideTypeDescriptor().PhotoItem;
|
||||
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO))
|
||||
secondaryItem = rideEntry->shop_item[1];
|
||||
|
||||
|
@ -6937,7 +6937,7 @@ static void window_ride_customer_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
|||
}
|
||||
|
||||
// Secondary shop items sold / on-ride photos sold
|
||||
shopItem = (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? RideTypeDescriptors[ride->type].PhotoItem
|
||||
shopItem = (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? ride->GetRideTypeDescriptor().PhotoItem
|
||||
: ride->GetRideEntry()->shop_item[1];
|
||||
if (shopItem != ShopItem::None)
|
||||
{
|
||||
|
|
|
@ -487,7 +487,7 @@ static bool is_track_enabled(int32_t trackFlagIndex)
|
|||
|
||||
static int32_t ride_get_alternative_type(Ride* ride)
|
||||
{
|
||||
return (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE) ? RideTypeDescriptors[ride->type].AlternateType
|
||||
return (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE) ? ride->GetRideTypeDescriptor().AlternateType
|
||||
: ride->type;
|
||||
}
|
||||
|
||||
|
@ -549,13 +549,13 @@ rct_window* window_ride_construction_open()
|
|||
_currentBrakeSpeed2 = 8;
|
||||
_currentSeatRotationAngle = 4;
|
||||
|
||||
_currentTrackCurve = RideTypeDescriptors[ride->type].StartTrackPiece | RideConstructionSpecialPieceSelected;
|
||||
_currentTrackCurve = ride->GetRideTypeDescriptor().StartTrackPiece | RideConstructionSpecialPieceSelected;
|
||||
_currentTrackSlopeEnd = 0;
|
||||
_currentTrackBankEnd = 0;
|
||||
_currentTrackLiftHill = 0;
|
||||
_currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES;
|
||||
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)
|
||||
if (ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)
|
||||
_currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE;
|
||||
|
||||
_previousTrackBankEnd = 0;
|
||||
|
@ -759,7 +759,7 @@ static void window_ride_construction_resize(rct_window* w)
|
|||
}
|
||||
if (!is_track_enabled(TRACK_SLOPE) && !is_track_enabled(TRACK_SLOPE_STEEP))
|
||||
{
|
||||
if (!RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
if (!ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
{
|
||||
// Disable all slopes
|
||||
disabledWidgets |= (1ULL << WIDX_SLOPE_GROUPBOX) | (1ULL << WIDX_SLOPE_DOWN_STEEP) | (1ULL << WIDX_SLOPE_DOWN)
|
||||
|
@ -1096,7 +1096,7 @@ static void window_ride_construction_resize(rct_window* w)
|
|||
disabledWidgets |= (1ULL << WIDX_SLOPE_UP_STEEP);
|
||||
}
|
||||
disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_LARGE) | (1ULL << WIDX_RIGHT_CURVE_LARGE);
|
||||
if (RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
{
|
||||
disabledWidgets |= (1ULL << WIDX_STRAIGHT) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_SMALL)
|
||||
| (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_LEFT_CURVE);
|
||||
|
@ -1109,7 +1109,7 @@ static void window_ride_construction_resize(rct_window* w)
|
|||
disabledWidgets |= (1ULL << WIDX_SLOPE_DOWN_STEEP);
|
||||
}
|
||||
disabledWidgets |= (1ULL << WIDX_LEFT_CURVE_LARGE) | (1ULL << WIDX_RIGHT_CURVE_LARGE);
|
||||
if (RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
{
|
||||
disabledWidgets |= (1ULL << WIDX_STRAIGHT) | (1ULL << WIDX_RIGHT_CURVE) | (1ULL << WIDX_RIGHT_CURVE_SMALL)
|
||||
| (1ULL << WIDX_LEFT_CURVE_SMALL) | (1ULL << WIDX_LEFT_CURVE);
|
||||
|
@ -1420,7 +1420,7 @@ static void window_ride_construction_mousedown(rct_window* w, rct_widgetindex wi
|
|||
{
|
||||
_currentTrackBankEnd = TRACK_BANK_NONE;
|
||||
}
|
||||
if (RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
{
|
||||
if (_rideConstructionState == RIDE_CONSTRUCTION_STATE_FRONT && _currentTrackCurve == TRACK_CURVE_NONE)
|
||||
{
|
||||
|
@ -2408,7 +2408,7 @@ static void sub_6CBCE2(
|
|||
CoordsXY coords = originCoords + offsets.Rotate(trackDirection);
|
||||
|
||||
int32_t baseZ = originZ + trackBlock->z;
|
||||
int32_t clearanceZ = trackBlock->var_07 + RideTypeDescriptors[ride->type].Heights.ClearanceHeight + baseZ
|
||||
int32_t clearanceZ = trackBlock->var_07 + ride->GetRideTypeDescriptor().Heights.ClearanceHeight + baseZ
|
||||
+ (4 * COORDS_Z_STEP);
|
||||
|
||||
auto centreTileCoords = TileCoordsXY{ coords };
|
||||
|
|
|
@ -115,7 +115,7 @@ GameActions::Result::Ptr MazePlaceTrackAction::Query() const
|
|||
return res;
|
||||
}
|
||||
|
||||
money32 price = (((RideTypeDescriptors[ride->type].BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
res->Cost = clearCost + price / 2 * 10;
|
||||
|
||||
return res;
|
||||
|
@ -163,7 +163,7 @@ GameActions::Result::Ptr MazePlaceTrackAction::Execute() const
|
|||
GameActions::Status::NoClearance, res->ErrorTitle.GetStringId(), gGameCommandErrorText, gCommonFormatArgs);
|
||||
}
|
||||
|
||||
money32 price = (((RideTypeDescriptors[ride->type].BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
res->Cost = clearCost + price / 2 * 10;
|
||||
|
||||
auto startLoc = _loc.ToTileStart();
|
||||
|
|
|
@ -134,7 +134,7 @@ GameActions::Result::Ptr MazeSetTrackAction::Query() const
|
|||
return res;
|
||||
}
|
||||
|
||||
money32 price = (((RideTypeDescriptors[ride->type].BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
res->Cost = price / 2 * 10;
|
||||
|
||||
return res;
|
||||
|
@ -176,7 +176,7 @@ GameActions::Result::Ptr MazeSetTrackAction::Execute() const
|
|||
auto tileElement = map_get_track_element_at_of_type_from_ride(_loc, TrackElemType::Maze, _rideIndex);
|
||||
if (tileElement == nullptr)
|
||||
{
|
||||
money32 price = (((RideTypeDescriptors[ride->type].BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
money32 price = (((ride->GetRideTypeDescriptor().BuildCosts.TrackPrice * TrackPricing[TrackElemType::Maze]) >> 16));
|
||||
res->Cost = price / 2 * 10;
|
||||
|
||||
auto startLoc = _loc.ToTileStart();
|
||||
|
|
|
@ -167,16 +167,16 @@ GameActions::Result::Ptr RideCreateAction::Execute() const
|
|||
ride->min_waiting_time = 10;
|
||||
ride->max_waiting_time = 60;
|
||||
ride->depart_flags = RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH | 3;
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT)
|
||||
if (ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT)
|
||||
{
|
||||
ride->lifecycle_flags |= RIDE_LIFECYCLE_MUSIC;
|
||||
}
|
||||
ride->music = RideTypeDescriptors[ride->type].DefaultMusic;
|
||||
ride->music = ride->GetRideTypeDescriptor().DefaultMusic;
|
||||
|
||||
const auto& operatingSettings = RideTypeDescriptors[ride->type].OperatingSettings;
|
||||
const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings;
|
||||
ride->operation_option = (operatingSettings.MinValue * 3 + operatingSettings.MaxValue) / 4;
|
||||
|
||||
ride->lift_hill_speed = RideTypeDescriptors[ride->type].LiftData.minimum_speed;
|
||||
ride->lift_hill_speed = ride->GetRideTypeDescriptor().LiftData.minimum_speed;
|
||||
|
||||
ride->measurement = {};
|
||||
ride->excitement = RIDE_RATING_UNDEFINED;
|
||||
|
@ -193,7 +193,7 @@ GameActions::Result::Ptr RideCreateAction::Execute() const
|
|||
{
|
||||
for (auto i = 0; i < NUM_SHOP_ITEMS_PER_RIDE; i++)
|
||||
{
|
||||
ride->price[i] = RideTypeDescriptors[ride->type].DefaultPrices[i];
|
||||
ride->price[i] = ride->GetRideTypeDescriptor().DefaultPrices[i];
|
||||
}
|
||||
|
||||
if (rideEntry->shop_item[0] == ShopItem::None)
|
||||
|
|
|
@ -87,7 +87,7 @@ GameActions::Result::Ptr RideDemolishAction::Query() const
|
|||
}
|
||||
|
||||
if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)
|
||||
|| RideTypeDescriptors[ride->type].AvailableBreakdowns == 0)
|
||||
|| ride->GetRideTypeDescriptor().AvailableBreakdowns == 0)
|
||||
{
|
||||
return std::make_unique<GameActions::Result>(
|
||||
GameActions::Status::Disallowed, STR_CANT_REFURBISH_RIDE, STR_CANT_REFURBISH_NOT_NEEDED);
|
||||
|
|
|
@ -121,7 +121,7 @@ GameActions::Result::Ptr RideSetPriceAction::Execute() const
|
|||
shopItem = rideEntry->shop_item[1];
|
||||
if (shopItem == ShopItem::None)
|
||||
{
|
||||
shopItem = RideTypeDescriptors[ride->type].PhotoItem;
|
||||
shopItem = ride->GetRideTypeDescriptor().PhotoItem;
|
||||
if ((ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) == 0)
|
||||
{
|
||||
ride->price[1] = _price;
|
||||
|
|
|
@ -239,13 +239,13 @@ GameActions::Result::Ptr RideSetSettingAction::Execute() const
|
|||
|
||||
bool RideSetSettingAction::ride_is_mode_valid(Ride* ride) const
|
||||
{
|
||||
return RideTypeDescriptors[ride->type].RideModes & (1ULL << _value);
|
||||
return ride->GetRideTypeDescriptor().RideModes & (1ULL << _value);
|
||||
}
|
||||
|
||||
bool RideSetSettingAction::ride_is_valid_lift_hill_speed(Ride* ride) const
|
||||
{
|
||||
int32_t minSpeed = gCheatsFastLiftHill ? 0 : RideTypeDescriptors[ride->type].LiftData.minimum_speed;
|
||||
int32_t maxSpeed = gCheatsFastLiftHill ? 255 : RideTypeDescriptors[ride->type].LiftData.maximum_speed;
|
||||
int32_t minSpeed = gCheatsFastLiftHill ? 0 : ride->GetRideTypeDescriptor().LiftData.minimum_speed;
|
||||
int32_t maxSpeed = gCheatsFastLiftHill ? 255 : ride->GetRideTypeDescriptor().LiftData.maximum_speed;
|
||||
return _value >= minSpeed && _value <= maxSpeed;
|
||||
}
|
||||
|
||||
|
@ -258,7 +258,7 @@ bool RideSetSettingAction::ride_is_valid_num_circuits() const
|
|||
|
||||
bool RideSetSettingAction::ride_is_valid_operation_option(Ride* ride) const
|
||||
{
|
||||
const auto& operatingSettings = RideTypeDescriptors[ride->type].OperatingSettings;
|
||||
const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings;
|
||||
uint8_t minValue = operatingSettings.MinValue;
|
||||
uint8_t maxValue = operatingSettings.MaxValue;
|
||||
if (gCheatsFastLiftHill)
|
||||
|
|
|
@ -108,7 +108,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
|
||||
res->GroundFlags = 0;
|
||||
|
||||
uint32_t rideTypeFlags = RideTypeDescriptors[ride->type].Flags;
|
||||
uint32_t rideTypeFlags = ride->GetRideTypeDescriptor().Flags;
|
||||
|
||||
if ((ride->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && _trackType == TrackElemType::EndStation)
|
||||
{
|
||||
|
@ -144,7 +144,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
}
|
||||
// Backwards steep lift hills are allowed, even on roller coasters that do not support forwards steep lift hills.
|
||||
if ((_trackPlaceFlags & CONSTRUCTION_LIFT_HILL_SELECTED)
|
||||
&& !RideTypeDescriptors[ride->type].SupportsTrackPiece(TRACK_LIFT_HILL_STEEP) && !gCheatsEnableChainLiftOnAllTrack)
|
||||
&& !ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_LIFT_HILL_STEEP) && !gCheatsEnableChainLiftOnAllTrack)
|
||||
{
|
||||
if (TrackFlags[_trackType] & TRACK_ELEM_FLAG_IS_STEEP_UP)
|
||||
{
|
||||
|
@ -212,13 +212,13 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
|
||||
int32_t clearanceZ = trackBlock->var_07;
|
||||
if (trackBlock->flags & RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL
|
||||
&& RideTypeDescriptors[ride->type].Heights.ClearanceHeight > 24)
|
||||
&& ride->GetRideTypeDescriptor().Heights.ClearanceHeight > 24)
|
||||
{
|
||||
clearanceZ += 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
clearanceZ += RideTypeDescriptors[ride->type].Heights.ClearanceHeight;
|
||||
clearanceZ += ride->GetRideTypeDescriptor().Heights.ClearanceHeight;
|
||||
}
|
||||
|
||||
clearanceZ = floor2(clearanceZ, COORDS_Z_STEP) + baseZ;
|
||||
|
@ -228,7 +228,7 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
return std::make_unique<TrackPlaceActionResult>(GameActions::Status::InvalidParameters, STR_TOO_HIGH);
|
||||
}
|
||||
|
||||
uint8_t crossingMode = (RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS)
|
||||
uint8_t crossingMode = (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS)
|
||||
&& _trackType == TrackElemType::Flat)
|
||||
? CREATE_CROSSING_MODE_TRACK_OVER_PATH
|
||||
: CREATE_CROSSING_MODE_NONE;
|
||||
|
@ -334,14 +334,14 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
{
|
||||
uint16_t maxHeight;
|
||||
|
||||
if (RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
&& rideEntry->max_height != 0)
|
||||
{
|
||||
maxHeight = rideEntry->max_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
maxHeight = RideTypeDescriptors[ride->type].Heights.MaxHeight;
|
||||
maxHeight = ride->GetRideTypeDescriptor().Heights.MaxHeight;
|
||||
}
|
||||
|
||||
ride_height /= COORDS_Z_PER_TINY_Z;
|
||||
|
@ -358,10 +358,10 @@ GameActions::Result::Ptr TrackPlaceAction::Query() const
|
|||
supportHeight = (10 * COORDS_Z_STEP);
|
||||
}
|
||||
|
||||
cost += ((supportHeight / (2 * COORDS_Z_STEP)) * RideTypeDescriptors[ride->type].BuildCosts.SupportPrice) * 5;
|
||||
cost += ((supportHeight / (2 * COORDS_Z_STEP)) * ride->GetRideTypeDescriptor().BuildCosts.SupportPrice) * 5;
|
||||
}
|
||||
|
||||
money32 price = RideTypeDescriptors[ride->type].BuildCosts.TrackPrice;
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[_trackType];
|
||||
|
||||
price >>= 16;
|
||||
|
@ -393,7 +393,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const
|
|||
|
||||
res->GroundFlags = 0;
|
||||
|
||||
uint32_t rideTypeFlags = RideTypeDescriptors[ride->type].Flags;
|
||||
uint32_t rideTypeFlags = ride->GetRideTypeDescriptor().Flags;
|
||||
|
||||
const uint8_t(*wallEdges)[16];
|
||||
wallEdges = &TrackSequenceElementAllowedWallEdges[_trackType];
|
||||
|
@ -412,19 +412,19 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const
|
|||
int32_t baseZ = floor2(mapLoc.z, COORDS_Z_STEP);
|
||||
int32_t clearanceZ = trackBlock->var_07;
|
||||
if (trackBlock->flags & RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL
|
||||
&& RideTypeDescriptors[ride->type].Heights.ClearanceHeight > 24)
|
||||
&& ride->GetRideTypeDescriptor().Heights.ClearanceHeight > 24)
|
||||
{
|
||||
clearanceZ += 24;
|
||||
}
|
||||
else
|
||||
{
|
||||
clearanceZ += RideTypeDescriptors[ride->type].Heights.ClearanceHeight;
|
||||
clearanceZ += ride->GetRideTypeDescriptor().Heights.ClearanceHeight;
|
||||
}
|
||||
|
||||
clearanceZ = floor2(clearanceZ, COORDS_Z_STEP) + baseZ;
|
||||
const auto mapLocWithClearance = CoordsXYRangedZ(mapLoc, baseZ, clearanceZ);
|
||||
|
||||
uint8_t crossingMode = (RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS)
|
||||
uint8_t crossingMode = (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS)
|
||||
&& _trackType == TrackElemType::Flat)
|
||||
? CREATE_CROSSING_MODE_TRACK_OVER_PATH
|
||||
: CREATE_CROSSING_MODE_NONE;
|
||||
|
@ -479,7 +479,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const
|
|||
supportHeight = (10 * COORDS_Z_STEP);
|
||||
}
|
||||
|
||||
cost += ((supportHeight / (2 * COORDS_Z_STEP)) * RideTypeDescriptors[ride->type].BuildCosts.SupportPrice) * 5;
|
||||
cost += ((supportHeight / (2 * COORDS_Z_STEP)) * ride->GetRideTypeDescriptor().BuildCosts.SupportPrice) * 5;
|
||||
|
||||
if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST))
|
||||
{
|
||||
|
@ -643,7 +643,7 @@ GameActions::Result::Ptr TrackPlaceAction::Execute() const
|
|||
map_invalidate_tile_full(mapLoc);
|
||||
}
|
||||
|
||||
money32 price = RideTypeDescriptors[ride->type].BuildCosts.TrackPrice;
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[_trackType];
|
||||
|
||||
price >>= 16;
|
||||
|
|
|
@ -222,10 +222,10 @@ GameActions::Result::Ptr TrackRemoveAction::Query() const
|
|||
_support_height = 10;
|
||||
}
|
||||
|
||||
cost += (_support_height / 2) * RideTypeDescriptors[ride->type].BuildCosts.SupportPrice;
|
||||
cost += (_support_height / 2) * ride->GetRideTypeDescriptor().BuildCosts.SupportPrice;
|
||||
}
|
||||
|
||||
money32 price = RideTypeDescriptors[ride->type].BuildCosts.TrackPrice;
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[trackType];
|
||||
price >>= 16;
|
||||
price = (price + cost) / 2;
|
||||
|
@ -396,7 +396,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const
|
|||
_support_height = 10;
|
||||
}
|
||||
|
||||
cost += (_support_height / 2) * RideTypeDescriptors[ride->type].BuildCosts.SupportPrice;
|
||||
cost += (_support_height / 2) * ride->GetRideTypeDescriptor().BuildCosts.SupportPrice;
|
||||
|
||||
// If the removed tile is a station modify station properties.
|
||||
// Don't do this if the ride is simulating and the tile is a ghost to prevent desyncs.
|
||||
|
@ -472,7 +472,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const
|
|||
}
|
||||
}
|
||||
|
||||
money32 price = RideTypeDescriptors[ride->type].BuildCosts.TrackPrice;
|
||||
money32 price = ride->GetRideTypeDescriptor().BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[trackType];
|
||||
price >>= 16;
|
||||
price = (price + cost) / 2;
|
||||
|
|
|
@ -456,7 +456,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack(
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_ALLOW_DOORS_ON_TRACK))
|
||||
if (!(ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_ALLOW_DOORS_ON_TRACK))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1710,7 +1710,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
|||
{
|
||||
// Peeps that are leaving the park will refuse to go on any rides, with the exception of free transport rides.
|
||||
assert(ride->type < std::size(RideTypeDescriptors));
|
||||
if (!(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|
||||
if (!(ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|
||||
|| ride_get_price(ride) != 0)
|
||||
{
|
||||
if (PeepFlags & PEEP_FLAGS_LEAVING_PARK)
|
||||
|
@ -1776,7 +1776,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
|||
// Assuming the queue conditions are met, peeps will always go on free transport rides.
|
||||
// Ride ratings, recent crashes and weather will all be ignored.
|
||||
money16 ridePrice = ride_get_price(ride);
|
||||
if (!(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|
||||
if (!(ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_TRANSPORT_RIDE) || ride->value == RIDE_VALUE_UNDEFINED
|
||||
|| ridePrice != 0)
|
||||
{
|
||||
if (PreviousRide == ride->id)
|
||||
|
@ -1908,7 +1908,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
|||
|
||||
// If the ride has not yet been rated and is capable of having g-forces,
|
||||
// there's a 90% chance that the peep will ignore it.
|
||||
if (!ride_has_ratings(ride) && (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_PEEP_CHECK_GFORCES))
|
||||
if (!ride_has_ratings(ride) && (ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_PEEP_CHECK_GFORCES))
|
||||
{
|
||||
if ((scenario_rand() & 0xFFFF) > 0x1999U)
|
||||
{
|
||||
|
@ -3421,7 +3421,7 @@ void Guest::UpdateRideAdvanceThroughEntrance()
|
|||
distanceThreshold += 4;
|
||||
if (xy_distance < distanceThreshold)
|
||||
{
|
||||
actionZ += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
actionZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
}
|
||||
|
||||
MoveTo({ *loc, actionZ });
|
||||
|
@ -3534,7 +3534,7 @@ void Guest::UpdateRideAdvanceThroughEntrance()
|
|||
*/
|
||||
static void peep_go_to_ride_exit(Peep* peep, Ride* ride, int16_t x, int16_t y, int16_t z, uint8_t exit_direction)
|
||||
{
|
||||
z += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
z += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
|
||||
peep->MoveTo({ x, y, z });
|
||||
|
||||
|
@ -4003,7 +4003,7 @@ void Guest::UpdateRideLeaveVehicle()
|
|||
Guard::Assert(!exitLocation.isNull());
|
||||
|
||||
auto waypointLoc = CoordsXYZ{ ride->stations[CurrentRideStation].Start.ToTileCentre(),
|
||||
exitLocation.z + RideTypeDescriptors[ride->type].Heights.PlatformHeight };
|
||||
exitLocation.z + ride->GetRideTypeDescriptor().Heights.PlatformHeight };
|
||||
|
||||
TileElement* trackElement = ride_get_station_start_track_element(ride, CurrentRideStation);
|
||||
|
||||
|
@ -4123,7 +4123,7 @@ void Guest::UpdateRideInExit()
|
|||
{
|
||||
int16_t actionZ = ride->stations[CurrentRideStation].GetBaseZ();
|
||||
|
||||
actionZ += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
actionZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
MoveTo({ *loc, actionZ });
|
||||
return;
|
||||
}
|
||||
|
@ -4134,7 +4134,7 @@ void Guest::UpdateRideInExit()
|
|||
|
||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)
|
||||
{
|
||||
ShopItem secondaryItem = RideTypeDescriptors[ride->type].PhotoItem;
|
||||
ShopItem secondaryItem = ride->GetRideTypeDescriptor().PhotoItem;
|
||||
if (DecideAndBuyItem(ride, secondaryItem, ride->price[1]))
|
||||
{
|
||||
ride->no_secondary_items_sold++;
|
||||
|
@ -5948,14 +5948,14 @@ static bool peep_should_watch_ride(TileElement* tileElement)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_INTERESTING_TO_LOOK_AT)
|
||||
if (ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_INTERESTING_TO_LOOK_AT)
|
||||
{
|
||||
if ((scenario_rand() & 0xFFFF) > 0x3333)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_SLIGHTLY_INTERESTING_TO_LOOK_AT)
|
||||
else if (ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_SLIGHTLY_INTERESTING_TO_LOOK_AT)
|
||||
{
|
||||
if ((scenario_rand() & 0xFFFF) > 0x1000)
|
||||
{
|
||||
|
|
|
@ -1458,7 +1458,7 @@ void Staff::UpdateHeadingToInspect()
|
|||
|
||||
if (delta_y < 20)
|
||||
{
|
||||
newZ += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
newZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
}
|
||||
|
||||
MoveTo({ *loc, newZ });
|
||||
|
@ -1567,7 +1567,7 @@ void Staff::UpdateAnswering()
|
|||
|
||||
if (delta_y < 20)
|
||||
{
|
||||
newZ += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
newZ += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
}
|
||||
|
||||
MoveTo({ *loc, newZ });
|
||||
|
@ -2613,7 +2613,7 @@ bool Staff::UpdateFixingLeaveByEntranceExit(bool firstRun, const Ride* ride)
|
|||
|
||||
if (xy_distance >= 16)
|
||||
{
|
||||
stationHeight += RideTypeDescriptors[ride->type].Heights.PlatformHeight;
|
||||
stationHeight += ride->GetRideTypeDescriptor().Heights.PlatformHeight;
|
||||
}
|
||||
|
||||
MoveTo({ *loc, stationHeight });
|
||||
|
|
|
@ -69,7 +69,7 @@ Vehicle* cable_lift_segment_create(
|
|||
|
||||
z = z * COORDS_Z_STEP;
|
||||
current->TrackLocation = { x, y, z };
|
||||
z += RideTypeDescriptors[ride.type].Heights.VehicleZOffset;
|
||||
z += ride.GetRideTypeDescriptor().Heights.VehicleZOffset;
|
||||
|
||||
current->MoveTo({ 16, 16, z });
|
||||
current->SetTrackType(TrackElemType::CableLiftHill);
|
||||
|
|
|
@ -1939,13 +1939,13 @@ int32_t ride_initialise_construction_window(Ride* ride)
|
|||
if (ride == nullptr)
|
||||
return 0;
|
||||
|
||||
_currentTrackCurve = RideTypeDescriptors[ride->type].StartTrackPiece | RideConstructionSpecialPieceSelected;
|
||||
_currentTrackCurve = ride->GetRideTypeDescriptor().StartTrackPiece | RideConstructionSpecialPieceSelected;
|
||||
_currentTrackSlopeEnd = 0;
|
||||
_currentTrackBankEnd = 0;
|
||||
_currentTrackLiftHill = 0;
|
||||
_currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES;
|
||||
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)
|
||||
if (ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)
|
||||
_currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE;
|
||||
|
||||
_previousTrackBankEnd = 0;
|
||||
|
@ -2274,7 +2274,7 @@ static void ride_inspection_update(Ride* ride)
|
|||
return;
|
||||
}
|
||||
|
||||
if (RideTypeDescriptors[ride->type].AvailableBreakdowns == 0)
|
||||
if (ride->GetRideTypeDescriptor().AvailableBreakdowns == 0)
|
||||
return;
|
||||
|
||||
if (inspectionIntervalMinutes > ride->last_inspection)
|
||||
|
@ -2396,7 +2396,7 @@ static int32_t ride_get_new_breakdown_problem(Ride* ride)
|
|||
if (!ride->CanBreakDown())
|
||||
return -1;
|
||||
|
||||
availableBreakdownProblems = RideTypeDescriptors[ride->type].AvailableBreakdowns;
|
||||
availableBreakdownProblems = ride->GetRideTypeDescriptor().AvailableBreakdowns;
|
||||
|
||||
// Calculate the total probability range for all possible breakdown problems
|
||||
totalProbability = 0;
|
||||
|
@ -2623,7 +2623,7 @@ static void ride_mechanic_status_update(Ride* ride, int32_t mechanicStatus)
|
|||
}
|
||||
break;
|
||||
case RIDE_MECHANIC_STATUS_CALLING:
|
||||
if (RideTypeDescriptors[ride->type].AvailableBreakdowns == 0)
|
||||
if (ride->GetRideTypeDescriptor().AvailableBreakdowns == 0)
|
||||
{
|
||||
ride->lifecycle_flags &= ~(
|
||||
RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_DUE_INSPECTION);
|
||||
|
@ -2808,8 +2808,8 @@ Staff* ride_get_assigned_mechanic(Ride* ride)
|
|||
*/
|
||||
static void ride_music_update(Ride* ride)
|
||||
{
|
||||
if (!(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT)
|
||||
&& !(RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_ALLOW_MUSIC))
|
||||
if (!(ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_MUSIC_ON_DEFAULT)
|
||||
&& !(ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_ALLOW_MUSIC))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -3372,7 +3372,7 @@ static void ride_station_set_map_tooltip(TileElement* tileElement)
|
|||
ft.Add<rct_string_id>(STR_RIDE_MAP_TIP);
|
||||
ft.Add<rct_string_id>(ride->num_stations <= 1 ? STR_RIDE_STATION : STR_RIDE_STATION_X);
|
||||
ride->FormatNameTo(ft);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[ride->type].NameConvention.station).capitalised);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).capitalised);
|
||||
ft.Add<uint16_t>(stationIndex + 1);
|
||||
ride->FormatStatusTo(ft);
|
||||
auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP);
|
||||
|
@ -4153,7 +4153,7 @@ static Vehicle* vehicle_create_car(
|
|||
vehicle->TrackLocation = dodgemPos;
|
||||
vehicle->current_station = trackElement->GetStationIndex();
|
||||
|
||||
dodgemPos.z += RideTypeDescriptors[ride->type].Heights.VehicleZOffset;
|
||||
dodgemPos.z += ride->GetRideTypeDescriptor().Heights.VehicleZOffset;
|
||||
|
||||
vehicle->SetTrackDirection(0);
|
||||
vehicle->SetTrackType(trackElement->GetTrackType());
|
||||
|
@ -4223,9 +4223,9 @@ static Vehicle* vehicle_create_car(
|
|||
{
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
{
|
||||
if (RideTypeDescriptors[ride->type].StartTrackPiece != TrackElemType::FlatTrack1x4B)
|
||||
if (ride->GetRideTypeDescriptor().StartTrackPiece != TrackElemType::FlatTrack1x4B)
|
||||
{
|
||||
if (RideTypeDescriptors[ride->type].StartTrackPiece != TrackElemType::FlatTrack1x4A)
|
||||
if (ride->GetRideTypeDescriptor().StartTrackPiece != TrackElemType::FlatTrack1x4A)
|
||||
{
|
||||
if (ride->type == RIDE_TYPE_ENTERPRISE)
|
||||
{
|
||||
|
@ -4240,7 +4240,7 @@ static Vehicle* vehicle_create_car(
|
|||
}
|
||||
}
|
||||
|
||||
chosenLoc += CoordsXYZ{ word_9A2A60[direction], RideTypeDescriptors[ride->type].Heights.VehicleZOffset };
|
||||
chosenLoc += CoordsXYZ{ word_9A2A60[direction], ride->GetRideTypeDescriptor().Heights.VehicleZOffset };
|
||||
|
||||
vehicle->current_station = trackElement->GetStationIndex();
|
||||
|
||||
|
|
|
@ -809,7 +809,7 @@ static void ride_ratings_calculate_value(Ride* ride)
|
|||
}
|
||||
|
||||
// Start with the base ratings, multiplied by the ride type specific weights for excitement, intensity and nausea.
|
||||
const auto& ratingsMultipliers = RideTypeDescriptors[ride->type].RatingsMultipliers;
|
||||
const auto& ratingsMultipliers = ride->GetRideTypeDescriptor().RatingsMultipliers;
|
||||
int32_t value = (((ride->excitement * ratingsMultipliers.Excitement) * 32) >> 15)
|
||||
+ (((ride->intensity * ratingsMultipliers.Intensity) * 32) >> 15)
|
||||
+ (((ride->nausea * ratingsMultipliers.Nausea) * 32) >> 15);
|
||||
|
@ -870,9 +870,9 @@ static void ride_ratings_calculate_value(Ride* ride)
|
|||
static uint16_t ride_compute_upkeep(Ride* ride)
|
||||
{
|
||||
// data stored at 0x0057E3A8, incrementing 18 bytes at a time
|
||||
uint16_t upkeep = RideTypeDescriptors[ride->type].UpkeepCosts.BaseCost;
|
||||
uint16_t upkeep = ride->GetRideTypeDescriptor().UpkeepCosts.BaseCost;
|
||||
|
||||
uint16_t trackCost = RideTypeDescriptors[ride->type].UpkeepCosts.CostPerTrackPiece;
|
||||
uint16_t trackCost = ride->GetRideTypeDescriptor().UpkeepCosts.CostPerTrackPiece;
|
||||
uint8_t dropFactor = ride->drops;
|
||||
|
||||
dropFactor >>= 6;
|
||||
|
@ -885,7 +885,7 @@ static uint16_t ride_compute_upkeep(Ride* ride)
|
|||
// rides that had tracks. The 0's were fixed rides like crooked house or
|
||||
// dodgems.
|
||||
// Data source is 0x0097E3AC
|
||||
totalLength *= RideTypeDescriptors[ride->type].UpkeepCosts.TrackLengthMultiplier;
|
||||
totalLength *= ride->GetRideTypeDescriptor().UpkeepCosts.TrackLengthMultiplier;
|
||||
upkeep += static_cast<uint16_t>(totalLength >> 10);
|
||||
|
||||
if (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)
|
||||
|
@ -912,12 +912,12 @@ static uint16_t ride_compute_upkeep(Ride* ride)
|
|||
// various variables set on the ride itself.
|
||||
|
||||
// https://gist.github.com/kevinburke/e19b803cd2769d96c540
|
||||
upkeep += RideTypeDescriptors[ride->type].UpkeepCosts.CostPerTrain * ride->num_vehicles;
|
||||
upkeep += RideTypeDescriptors[ride->type].UpkeepCosts.CostPerCar * ride->num_cars_per_train;
|
||||
upkeep += ride->GetRideTypeDescriptor().UpkeepCosts.CostPerTrain * ride->num_vehicles;
|
||||
upkeep += ride->GetRideTypeDescriptor().UpkeepCosts.CostPerCar * ride->num_cars_per_train;
|
||||
|
||||
// slight upkeep boosts for some rides - 5 for mini railway, 10 for log
|
||||
// flume/rapids, 10 for roller coaster, 28 for giga coaster
|
||||
upkeep += RideTypeDescriptors[ride->type].UpkeepCosts.CostPerStation * ride->num_stations;
|
||||
upkeep += ride->GetRideTypeDescriptor().UpkeepCosts.CostPerStation * ride->num_stations;
|
||||
|
||||
if (ride->mode == RideMode::ReverseInclineLaunchedShuttle)
|
||||
{
|
||||
|
@ -969,7 +969,7 @@ static void ride_ratings_apply_adjustments(Ride* ride, RatingTuple* ratings)
|
|||
|
||||
// Apply total air time
|
||||
#ifdef ORIGINAL_RATINGS
|
||||
if (RideTypeDescriptors[ride->type].HasFlag(RIDE_TYPE_FLAG_HAS_AIR_TIME))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_AIR_TIME))
|
||||
{
|
||||
uint16_t totalAirTime = ride->total_air_time;
|
||||
if (rideEntry->flags & RIDE_ENTRY_FLAG_LIMIT_AIRTIME_BONUS)
|
||||
|
@ -988,7 +988,7 @@ static void ride_ratings_apply_adjustments(Ride* ride, RatingTuple* ratings)
|
|||
}
|
||||
}
|
||||
#else
|
||||
if (RideTypeDescriptors[ride->type].Flags & RIDE_TYPE_FLAG_HAS_AIR_TIME)
|
||||
if (ride->GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_HAS_AIR_TIME)
|
||||
{
|
||||
int32_t excitementModifier;
|
||||
if (rideEntry->flags & RIDE_ENTRY_FLAG_LIMIT_AIRTIME_BONUS)
|
||||
|
@ -1032,7 +1032,7 @@ static void ride_ratings_apply_intensity_penalty(RatingTuple* ratings)
|
|||
static void set_unreliability_factor(Ride* ride)
|
||||
{
|
||||
// The bigger the difference in lift speed and minimum the higher the unreliability
|
||||
uint8_t minLiftSpeed = RideTypeDescriptors[ride->type].LiftData.minimum_speed;
|
||||
uint8_t minLiftSpeed = ride->GetRideTypeDescriptor().LiftData.minimum_speed;
|
||||
ride->unreliability_factor += (ride->lift_hill_speed - minLiftSpeed) * 2;
|
||||
}
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ rct_string_id TrackDesign::CreateTrackDesignTrack(const Ride& ride)
|
|||
if (trackElement.element->AsTrack()->HasChain())
|
||||
trackFlags |= RCT12_TRACK_ELEMENT_TYPE_FLAG_CHAIN_LIFT;
|
||||
trackFlags |= trackElement.element->AsTrack()->GetColourScheme() << 4;
|
||||
if (RideTypeDescriptors[ride.type].Flags & RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE
|
||||
if (ride.GetRideTypeDescriptor().Flags & RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE
|
||||
&& trackElement.element->AsTrack()->IsInverted())
|
||||
{
|
||||
trackFlags |= TD6_TRACK_ELEMENT_FLAG_INVERTED;
|
||||
|
|
|
@ -2157,7 +2157,7 @@ void track_paint(paint_session* session, Direction direction, int32_t height, co
|
|||
session->InteractionType = ViewportInteractionItem::None;
|
||||
if (TrackHeightMarkerPositions[trackType] & (1 << trackSequence))
|
||||
{
|
||||
uint16_t ax = RideTypeDescriptors[ride->type].Heights.VehicleZOffset;
|
||||
uint16_t ax = ride->GetRideTypeDescriptor().Heights.VehicleZOffset;
|
||||
// 0x1689 represents 0 height there are -127 to 128 heights above and below it
|
||||
// There are 3 arrays of 256 heights (units, m, ft) chosen with the get_height_marker_offset()
|
||||
uint32_t imageId = SPRITE_ID_PALETTE_COLOUR_1(COLOUR_LIGHT_BLUE) | (0x1689 + get_height_marker_offset());
|
||||
|
@ -2194,7 +2194,7 @@ void track_paint(paint_session* session, Direction direction, int32_t height, co
|
|||
{
|
||||
return;
|
||||
}
|
||||
TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = RideTypeDescriptors[ride->type].TrackPaintFunction;
|
||||
TRACK_PAINT_FUNCTION_GETTER paintFunctionGetter = ride->GetRideTypeDescriptor().TrackPaintFunction;
|
||||
if (paintFunctionGetter != nullptr)
|
||||
{
|
||||
TRACK_PAINT_FUNCTION paintFunction = paintFunctionGetter(trackType);
|
||||
|
|
|
@ -563,7 +563,7 @@ uint32_t Park::CalculateSuggestedMaxGuests() const
|
|||
continue;
|
||||
|
||||
// Add guest score for ride type
|
||||
suggestedMaxGuests += RideTypeDescriptors[ride.type].BonusValue;
|
||||
suggestedMaxGuests += ride.GetRideTypeDescriptor().BonusValue;
|
||||
}
|
||||
|
||||
// If difficult guest generation, extra guests are available for good rides
|
||||
|
@ -588,7 +588,7 @@ uint32_t Park::CalculateSuggestedMaxGuests() const
|
|||
continue;
|
||||
|
||||
// Bonus guests for good ride
|
||||
suggestedMaxGuests += RideTypeDescriptors[ride.type].BonusValue * 2;
|
||||
suggestedMaxGuests += ride.GetRideTypeDescriptor().BonusValue * 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ protected:
|
|||
{
|
||||
RatingTuple ratings = ride.ratings;
|
||||
std::string line = String::StdFormat(
|
||||
"%s: (%d, %d, %d)", RideTypeDescriptors[ride.type].EnumName, static_cast<int>(ratings.Excitement),
|
||||
"%s: (%d, %d, %d)", ride.GetRideTypeDescriptor().EnumName, static_cast<int>(ratings.Excitement),
|
||||
static_cast<int>(ratings.Intensity), static_cast<int>(ratings.Nausea));
|
||||
return line;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue