mirror of https://github.com/OpenRCT2/OpenRCT2.git
Use the RTD instead of ride_type_has_flag()
This commit is contained in:
parent
429f6fb845
commit
56399e7188
|
@ -186,7 +186,7 @@ public:
|
|||
if (guestRide != nullptr)
|
||||
{
|
||||
ft.Add<rct_string_id>(
|
||||
ride_type_has_flag(guestRide->type, RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE);
|
||||
guestRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE);
|
||||
guestRide->FormatNameTo(ft);
|
||||
|
||||
_selectedFilter = GuestFilterType::Guests;
|
||||
|
|
|
@ -384,7 +384,7 @@ static void window_maze_construction_entrance_tooldown(const ScreenCoordsXY& scr
|
|||
if (ride != nullptr && ride_are_all_possible_entrances_and_exits_built(ride))
|
||||
{
|
||||
tool_cancel();
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
window_close_by_class(WC_RIDE_CONSTRUCTION);
|
||||
}
|
||||
else
|
||||
|
|
|
@ -404,10 +404,9 @@ void WindowCampaignRefreshRides()
|
|||
{
|
||||
if (ride.status == RIDE_STATUS_OPEN)
|
||||
{
|
||||
if (!ride_type_has_flag(
|
||||
ride.type,
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(
|
||||
RIDE_TYPE_FLAG_IS_SHOP | RIDE_TYPE_FLAG_SELLS_FOOD | RIDE_TYPE_FLAG_SELLS_DRINKS
|
||||
| RIDE_TYPE_FLAG_IS_TOILET))
|
||||
| RIDE_TYPE_FLAG_IS_TOILET))
|
||||
{
|
||||
window_new_campaign_rides.push_back(ride.id);
|
||||
}
|
||||
|
|
|
@ -1142,16 +1142,15 @@ static void window_ride_disable_tabs(rct_window* w)
|
|||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
uint8_t ride_type = ride->type; // ecx
|
||||
const auto& rtd = ride->GetRideTypeDescriptor();
|
||||
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_DATA_LOGGING))
|
||||
disabled_tabs |= (1 << WIDX_TAB_8); // 0x800
|
||||
|
||||
if (ride_type == RIDE_TYPE_MINI_GOLF)
|
||||
if (ride->type == RIDE_TYPE_MINI_GOLF)
|
||||
disabled_tabs |= (1 << WIDX_TAB_2 | 1 << WIDX_TAB_3 | 1 << WIDX_TAB_4); // 0xE0
|
||||
|
||||
if (ride_type_has_flag(ride_type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
disabled_tabs |= (1 << WIDX_TAB_2); // 0x20
|
||||
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN) && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL)
|
||||
|
@ -1169,7 +1168,7 @@ static void window_ride_disable_tabs(rct_window* w)
|
|||
disabled_tabs |= (1 << WIDX_TAB_6); // 0x200
|
||||
}
|
||||
|
||||
if (ride_type == RIDE_TYPE_CASH_MACHINE || ride_type == RIDE_TYPE_FIRST_AID || (gParkFlags & PARK_FLAGS_NO_MONEY) != 0)
|
||||
if (ride->type == RIDE_TYPE_CASH_MACHINE || ride->type == RIDE_TYPE_FIRST_AID || (gParkFlags & PARK_FLAGS_NO_MONEY) != 0)
|
||||
disabled_tabs |= (1 << WIDX_TAB_9); // 0x1000
|
||||
|
||||
if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) != 0)
|
||||
|
@ -1333,7 +1332,7 @@ static rct_window* window_ride_open_station(Ride* ride, StationIndex stationInde
|
|||
if (ride->type >= RIDE_TYPE_COUNT)
|
||||
return nullptr;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
return window_ride_main_open(ride);
|
||||
|
||||
auto w = window_bring_to_front_by_number(WC_RIDE, ride->id);
|
||||
|
@ -1863,7 +1862,7 @@ static void window_ride_show_view_dropdown(rct_window* w, rct_widget* widget)
|
|||
return;
|
||||
|
||||
int32_t numItems = 1;
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
numItems += ride->num_stations;
|
||||
numItems += ride->num_vehicles;
|
||||
|
@ -2084,7 +2083,7 @@ static void populate_vehicle_type_dropdown(Ride* ride)
|
|||
int32_t rideTypeIterator, rideTypeIteratorMax;
|
||||
if (gCheatsShowVehiclesFromOtherTrackTypes
|
||||
&& !(
|
||||
ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE
|
||||
ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE
|
||||
|| ride->type == RIDE_TYPE_MINI_GOLF))
|
||||
{
|
||||
selectionShouldBeExpanded = true;
|
||||
|
@ -3482,7 +3481,7 @@ static void window_ride_operating_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Leave if another vehicle arrives at station
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_LEAVE_WHEN_ANOTHER_VEHICLE_ARRIVES_AT_STATION)
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LEAVE_WHEN_ANOTHER_VEHICLE_ARRIVES_AT_STATION)
|
||||
&& ride->num_vehicles > 1 && !ride->IsBlockSectioned())
|
||||
{
|
||||
window_ride_operating_widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].type = WindowWidgetType::Checkbox;
|
||||
|
@ -3500,7 +3499,7 @@ static void window_ride_operating_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Synchronise with adjacent stations
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS))
|
||||
{
|
||||
window_ride_operating_widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].type = WindowWidgetType::Checkbox;
|
||||
window_ride_operating_widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].image
|
||||
|
@ -3518,7 +3517,7 @@ static void window_ride_operating_invalidate(rct_window* w)
|
|||
|
||||
// Waiting
|
||||
window_ride_operating_widgets[WIDX_LOAD].text = VehicleLoadNames[(ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD_MASK)];
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS))
|
||||
{
|
||||
window_ride_operating_widgets[WIDX_LOAD_CHECKBOX].type = WindowWidgetType::Checkbox;
|
||||
window_ride_operating_widgets[WIDX_LOAD].type = WindowWidgetType::DropdownMenu;
|
||||
|
@ -3624,7 +3623,7 @@ static void window_ride_operating_invalidate(rct_window* w)
|
|||
format = STR_MAX_PEOPLE_ON_RIDE_VALUE;
|
||||
caption = STR_MAX_PEOPLE_ON_RIDE;
|
||||
tooltip = STR_MAX_PEOPLE_ON_RIDE_TIP;
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
format = 0;
|
||||
break;
|
||||
}
|
||||
|
@ -4184,7 +4183,7 @@ static int32_t window_ride_has_track_colour(Ride* ride, int32_t trackColour)
|
|||
{
|
||||
// Get station flags (shops don't have them)
|
||||
auto stationObjFlags = 0;
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
auto stationObj = ride_get_station_object(ride);
|
||||
if (stationObj != nullptr)
|
||||
|
@ -4197,12 +4196,12 @@ static int32_t window_ride_has_track_colour(Ride* ride, int32_t trackColour)
|
|||
{
|
||||
case 0:
|
||||
return (stationObjFlags & STATION_OBJECT_FLAGS::HAS_PRIMARY_COLOUR)
|
||||
|| ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN);
|
||||
|| ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN);
|
||||
case 1:
|
||||
return (stationObjFlags & STATION_OBJECT_FLAGS::HAS_SECONDARY_COLOUR)
|
||||
|| ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL);
|
||||
|| ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL);
|
||||
case 2:
|
||||
return ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS);
|
||||
return ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS);
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
@ -4600,7 +4599,7 @@ static void window_ride_colour_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Track, multiple colour schemes
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_SUPPORTS_MULTIPLE_TRACK_COLOUR))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SUPPORTS_MULTIPLE_TRACK_COLOUR))
|
||||
{
|
||||
window_ride_colour_widgets[WIDX_TRACK_COLOUR_SCHEME].type = WindowWidgetType::DropdownMenu;
|
||||
window_ride_colour_widgets[WIDX_TRACK_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Button;
|
||||
|
@ -4648,10 +4647,9 @@ static void window_ride_colour_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Track preview
|
||||
if (ride_type_has_flag(
|
||||
ride->type,
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(
|
||||
RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN | RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL
|
||||
| RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS))
|
||||
| RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS))
|
||||
window_ride_colour_widgets[WIDX_TRACK_PREVIEW].type = WindowWidgetType::Spinner;
|
||||
else
|
||||
window_ride_colour_widgets[WIDX_TRACK_PREVIEW].type = WindowWidgetType::Empty;
|
||||
|
@ -4679,8 +4677,8 @@ static void window_ride_colour_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Vehicle colours
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES)
|
||||
&& ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_VEHICLE_COLOURS))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)
|
||||
&& ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_VEHICLE_COLOURS))
|
||||
{
|
||||
int32_t vehicleColourSchemeType = ride->colour_scheme_type & 3;
|
||||
if (vehicleColourSchemeType == 0)
|
||||
|
@ -4733,7 +4731,7 @@ static void window_ride_colour_invalidate(rct_window* w)
|
|||
}
|
||||
|
||||
// Vehicle colour scheme type
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL)
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL)
|
||||
&& (ride->num_cars_per_train | ride->num_vehicles) > 1)
|
||||
{
|
||||
window_ride_colour_widgets[WIDX_VEHICLE_COLOUR_SCHEME].type = WindowWidgetType::DropdownMenu;
|
||||
|
@ -5406,7 +5404,7 @@ static void window_ride_measurements_mousedown(rct_window* w, rct_widgetindex wi
|
|||
{ w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[1],
|
||||
Dropdown::Flag::StayOpen, 2);
|
||||
gDropdownDefaultIndex = 0;
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
{
|
||||
// Disable saving without scenery if we're a flat ride
|
||||
Dropdown::SetDisabled(0, true);
|
||||
|
@ -5732,7 +5730,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
|
||||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
{
|
||||
// Max. positive vertical G's
|
||||
maxPositiveVerticalGs = ride->max_positive_vertical_g;
|
||||
|
@ -5760,7 +5758,7 @@ static void window_ride_measurements_paint(rct_window* w, rct_drawpixelinfo* dpi
|
|||
screenCoords.y += LIST_ROW_HEIGHT;
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_DROPS))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_DROPS))
|
||||
{
|
||||
// Drops
|
||||
drops = ride->drops & 0x3F;
|
||||
|
@ -6008,7 +6006,7 @@ static void window_ride_graphs_invalidate(rct_window* w)
|
|||
w->pressed_widgets |= (1LL << (WIDX_GRAPH_VELOCITY + (w->list_information_type & 0xFF)));
|
||||
|
||||
// Hide graph buttons that are not applicable
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
{
|
||||
window_ride_graphs_widgets[WIDX_GRAPH_VERTICAL].type = WindowWidgetType::Button;
|
||||
window_ride_graphs_widgets[WIDX_GRAPH_LATERAL].type = WindowWidgetType::Button;
|
||||
|
@ -6839,7 +6837,7 @@ static void window_ride_customer_invalidate(rct_window* w)
|
|||
ride->FormatNameTo(ft);
|
||||
|
||||
window_ride_customer_widgets[WIDX_SHOW_GUESTS_THOUGHTS].type = WindowWidgetType::FlatBtn;
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
window_ride_customer_widgets[WIDX_SHOW_GUESTS_ON_RIDE].type = WindowWidgetType::Empty;
|
||||
window_ride_customer_widgets[WIDX_SHOW_GUESTS_QUEUING].type = WindowWidgetType::Empty;
|
||||
|
|
|
@ -2727,7 +2727,7 @@ static void window_ride_construction_update_possible_ride_configurations()
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
{
|
||||
if (TrackDefinitions[trackType].type == TRACK_HELIX_SMALL || TrackDefinitions[trackType].type == TRACK_HELIX_LARGE)
|
||||
{
|
||||
|
@ -2749,7 +2749,7 @@ static void window_ride_construction_update_possible_ride_configurations()
|
|||
_currentDisabledSpecialTrackPieces |= (1 << currentPossibleRideConfigurationIndex);
|
||||
if (_currentTrackPieceDirection < 4 && slope == _previousTrackSlopeEnd && bank == _previousTrackBankEnd
|
||||
&& (trackType != TrackElemType::TowerBase
|
||||
|| ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES)))
|
||||
|| ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_EXTRA_TOWER_BASES)))
|
||||
{
|
||||
_currentDisabledSpecialTrackPieces &= ~(1 << currentPossibleRideConfigurationIndex);
|
||||
_numCurrentPossibleSpecialTrackPieces++;
|
||||
|
@ -2903,7 +2903,7 @@ static void window_ride_construction_update_widgets(rct_window* w)
|
|||
|
||||
int32_t x;
|
||||
if ((is_track_enabled(TRACK_LIFT_HILL) && (_currentTrackCurve & RideConstructionSpecialPieceSelected) == 0)
|
||||
|| (gCheatsEnableChainLiftOnAllTrack && ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK)))
|
||||
|| (gCheatsEnableChainLiftOnAllTrack && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)))
|
||||
{
|
||||
window_ride_construction_widgets[WIDX_CHAIN_LIFT].type = WindowWidgetType::FlatBtn;
|
||||
x = 9;
|
||||
|
@ -3540,7 +3540,7 @@ void ride_construction_toolupdate_construct(const ScreenCoordsXY& screenCoords)
|
|||
}
|
||||
|
||||
if (_autoRotatingShop && _rideConstructionState == RIDE_CONSTRUCTION_STATE_PLACE
|
||||
&& ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
&& ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
TileElement* pathsByDir[NumOrthogonalDirections];
|
||||
|
||||
|
@ -3870,7 +3870,7 @@ static void ride_construction_tooldown_entrance_exit(const ScreenCoordsXY& scree
|
|||
if (ride != nullptr && ride_are_all_possible_entrances_and_exits_built(ride))
|
||||
{
|
||||
tool_cancel();
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
window_close_by_class(WC_RIDE_CONSTRUCTION);
|
||||
}
|
||||
|
|
|
@ -245,7 +245,7 @@ GameActions::Result::Ptr RideCreateAction::Execute() const
|
|||
}
|
||||
|
||||
// Set the on-ride photo price, whether the ride has one or not (except shops).
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP) && shop_item_has_common_price(ShopItem::Photo))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP) && shop_item_has_common_price(ShopItem::Photo))
|
||||
{
|
||||
money32 price = shop_item_get_common_price(ride, ShopItem::Photo);
|
||||
if (price != MONEY32_UNDEFINED)
|
||||
|
|
|
@ -287,7 +287,7 @@ rct_string_id RideSetSettingAction::GetOperationErrorMessage(Ride* ride) const
|
|||
case RideMode::BackwardRotation:
|
||||
return STR_CANT_CHANGE_NUMBER_OF_ROTATIONS;
|
||||
default:
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
return STR_CANT_CHANGE_THIS;
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ bool RideSetVehicleAction::ride_is_vehicle_type_valid(Ride* ride) const
|
|||
|
||||
if (gCheatsShowVehiclesFromOtherTrackTypes
|
||||
&& !(
|
||||
ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE
|
||||
ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) || ride->type == RIDE_TYPE_MAZE
|
||||
|| ride->type == RIDE_TYPE_MINI_GOLF))
|
||||
{
|
||||
selectionShouldBeExpanded = true;
|
||||
|
|
|
@ -410,7 +410,7 @@ GameActions::Result::Ptr TrackRemoveAction::Execute() const
|
|||
}
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_TRACK_MUST_BE_ON_WATER))
|
||||
{
|
||||
surfaceElement->SetHasTrackThatNeedsWater(false);
|
||||
}
|
||||
|
|
|
@ -284,7 +284,7 @@ static bool award_is_deserved_best_food(int32_t activeAwardTypes)
|
|||
{
|
||||
if (ride.status != RIDE_STATUS_OPEN)
|
||||
continue;
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_SELLS_FOOD))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SELLS_FOOD))
|
||||
continue;
|
||||
|
||||
shops++;
|
||||
|
@ -328,7 +328,7 @@ static bool award_is_deserved_worst_food(int32_t activeAwardTypes)
|
|||
{
|
||||
if (ride.status != RIDE_STATUS_OPEN)
|
||||
continue;
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_SELLS_FOOD))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SELLS_FOOD))
|
||||
continue;
|
||||
|
||||
shops++;
|
||||
|
@ -453,7 +453,7 @@ static bool award_is_deserved_best_custom_designed_rides(int32_t activeAwardType
|
|||
auto customDesignedRides = 0;
|
||||
for (const auto& ride : GetRideManager())
|
||||
{
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
continue;
|
||||
if (ride.lifecycle_flags & RIDE_LIFECYCLE_NOT_CUSTOM_DESIGN)
|
||||
continue;
|
||||
|
@ -481,7 +481,7 @@ static bool award_is_deserved_most_dazzling_ride_colours(int32_t activeAwardType
|
|||
auto colourfulRides = 0;
|
||||
for (const auto& ride : GetRideManager())
|
||||
{
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
continue;
|
||||
|
||||
countedRides++;
|
||||
|
|
|
@ -777,7 +777,7 @@ void Guest::Tick128UpdateGuest(int32_t index)
|
|||
auto ride = get_ride(CurrentRide);
|
||||
if (ride != nullptr)
|
||||
{
|
||||
PeepThoughtType thought_type = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE)
|
||||
PeepThoughtType thought_type = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE)
|
||||
? PeepThoughtType::GetOut
|
||||
: PeepThoughtType::GetOff;
|
||||
|
||||
|
@ -1720,7 +1720,7 @@ bool Guest::ShouldGoOnRide(Ride* ride, int32_t entranceNum, bool atQueue, bool t
|
|||
}
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
return ShouldGoToShop(ride, peepAtRide);
|
||||
}
|
||||
|
@ -2207,7 +2207,7 @@ static void peep_ride_is_too_intense(Guest* peep, Ride* ride, bool peepAtRide)
|
|||
static Vehicle* peep_choose_car_from_ride(Peep* peep, Ride* ride, std::vector<uint8_t>& car_array)
|
||||
{
|
||||
uint8_t chosen_car = scenario_rand();
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_G_FORCES) && ((chosen_car & 0xC) != 0xC))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES) && ((chosen_car & 0xC) != 0xC))
|
||||
{
|
||||
chosen_car = (scenario_rand() & 1) ? 0 : static_cast<uint8_t>(car_array.size()) - 1;
|
||||
}
|
||||
|
@ -2611,7 +2611,7 @@ static void peep_update_ride_nausea_growth(Peep* peep, Ride* ride)
|
|||
|
||||
static bool peep_should_go_on_ride_again(Peep* peep, Ride* ride)
|
||||
{
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_PEEP_WILL_RIDE_AGAIN))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_PEEP_WILL_RIDE_AGAIN))
|
||||
return false;
|
||||
if (!ride_has_ratings(ride))
|
||||
return false;
|
||||
|
@ -2998,7 +2998,7 @@ static void peep_head_for_nearest_ride_with_flags(Guest* peep, int32_t rideTypeF
|
|||
return;
|
||||
}
|
||||
peep_head_for_nearest_ride(
|
||||
peep, false, [rideTypeFlags](const Ride& ride) { return ride_type_has_flag(ride.type, rideTypeFlags); });
|
||||
peep, false, [rideTypeFlags](const Ride& ride) { return ride.GetRideTypeDescriptor().HasFlag(rideTypeFlags); });
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3229,7 +3229,7 @@ void Guest::UpdateRideAtEntrance()
|
|||
|
||||
std::vector<uint8_t> carArray;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
if (ride->num_riders >= ride->operation_option)
|
||||
return;
|
||||
|
@ -3256,7 +3256,7 @@ void Guest::UpdateRideAtEntrance()
|
|||
return;
|
||||
}
|
||||
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
Vehicle* vehicle = peep_choose_car_from_ride(this, ride, carArray);
|
||||
peep_choose_seat_from_car(this, ride, vehicle);
|
||||
|
@ -3429,7 +3429,7 @@ void Guest::UpdateRideAdvanceThroughEntrance()
|
|||
}
|
||||
|
||||
Guard::Assert(RideSubState == PeepRideSubState::LeaveEntrance, "Peep ridesubstate should be LeaveEntrance");
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
auto entranceLocation = ride_get_entrance_location(ride, CurrentRideStation).ToCoordsXYZD();
|
||||
Guard::Assert(!entranceLocation.isNull());
|
||||
|
@ -3617,7 +3617,7 @@ void Guest::UpdateRideFreeVehicleEnterRide(Ride* ride)
|
|||
ride->FormatNameTo(ft);
|
||||
|
||||
rct_string_id msg_string;
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE))
|
||||
msg_string = STR_PEEP_TRACKING_PEEP_IS_IN_X;
|
||||
else
|
||||
msg_string = STR_PEEP_TRACKING_PEEP_IS_ON_X;
|
||||
|
@ -3671,7 +3671,7 @@ void Guest::UpdateRideFreeVehicleCheck()
|
|||
if (ride == nullptr)
|
||||
return;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES))
|
||||
{
|
||||
if (ride->status != RIDE_STATUS_OPEN || ride->vehicle_change_timeout != 0 || (++RejoinQueueTimeout) == 0)
|
||||
{
|
||||
|
@ -3897,7 +3897,7 @@ void Guest::UpdateRideLeaveVehicle()
|
|||
|
||||
platformLocation.direction = direction_reverse(exitLocation.direction);
|
||||
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
{
|
||||
for (; vehicle != nullptr && !vehicle->IsHead(); vehicle = GetEntity<Vehicle>(vehicle->prev_vehicle_on_ride))
|
||||
{
|
||||
|
|
|
@ -345,7 +345,7 @@ static uint8_t footpath_element_dest_in_dir(
|
|||
continue;
|
||||
ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex();
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride != nullptr && ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride != nullptr && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
*outRideIndex = rideIndex;
|
||||
return PATH_SEARCH_SHOP_ENTRANCE;
|
||||
|
@ -754,7 +754,7 @@ static void peep_pathfind_heuristic_search(
|
|||
* tile. */
|
||||
rideIndex = tileElement->AsTrack()->GetRideIndex();
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride == nullptr || !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride == nullptr || !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
continue;
|
||||
|
||||
found = true;
|
||||
|
|
|
@ -1215,7 +1215,7 @@ void peep_problem_warnings_update()
|
|||
break;
|
||||
}
|
||||
ride = get_ride(peep->GuestHeadingToRideId);
|
||||
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
if (ride != nullptr && !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
hunger_counter++;
|
||||
break;
|
||||
|
||||
|
@ -1226,7 +1226,7 @@ void peep_problem_warnings_update()
|
|||
break;
|
||||
}
|
||||
ride = get_ride(peep->GuestHeadingToRideId);
|
||||
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_SELLS_DRINKS))
|
||||
if (ride != nullptr && !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SELLS_DRINKS))
|
||||
thirst_counter++;
|
||||
break;
|
||||
|
||||
|
@ -1237,7 +1237,7 @@ void peep_problem_warnings_update()
|
|||
break;
|
||||
}
|
||||
ride = get_ride(peep->GuestHeadingToRideId);
|
||||
if (ride != nullptr && !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_TOILET))
|
||||
if (ride != nullptr && !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_TOILET))
|
||||
toilet_counter++;
|
||||
break;
|
||||
|
||||
|
@ -1794,7 +1794,8 @@ void Peep::FormatActionTo(Formatter& ft) const
|
|||
auto ride = get_ride(CurrentRide);
|
||||
if (ride != nullptr)
|
||||
{
|
||||
ft.Add<rct_string_id>(ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE);
|
||||
ft.Add<rct_string_id>(
|
||||
ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE);
|
||||
ride->FormatNameTo(ft);
|
||||
}
|
||||
else
|
||||
|
@ -2863,7 +2864,7 @@ static bool peep_interact_with_shop(Peep* peep, const CoordsXYE& coords)
|
|||
{
|
||||
ride_id_t rideIndex = coords.element->AsTrack()->GetRideIndex();
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride == nullptr || !ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride == nullptr || !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
return false;
|
||||
|
||||
auto* guest = peep->As<Guest>();
|
||||
|
@ -2900,7 +2901,7 @@ static bool peep_interact_with_shop(Peep* peep, const CoordsXYE& coords)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_PEEP_SHOULD_GO_INSIDE_FACILITY))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_PEEP_SHOULD_GO_INSIDE_FACILITY))
|
||||
{
|
||||
peep->TimeLost = 0;
|
||||
if (!guest->ShouldGoOnRide(ride, 0, false, false))
|
||||
|
@ -2933,8 +2934,9 @@ static bool peep_interact_with_shop(Peep* peep, const CoordsXYE& coords)
|
|||
auto ft = Formatter();
|
||||
peep->FormatNameTo(ft);
|
||||
ride->FormatNameTo(ft);
|
||||
rct_string_id string_id = ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IN_RIDE) ? STR_PEEP_TRACKING_PEEP_IS_IN_X
|
||||
: STR_PEEP_TRACKING_PEEP_IS_ON_X;
|
||||
rct_string_id string_id = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE)
|
||||
? STR_PEEP_TRACKING_PEEP_IS_IN_X
|
||||
: STR_PEEP_TRACKING_PEEP_IS_ON_X;
|
||||
if (gConfigNotifications.guest_used_facility)
|
||||
{
|
||||
News::AddItemToQueue(News::ItemType::PeepOnRide, string_id, peep->sprite_index, ft);
|
||||
|
|
|
@ -2268,7 +2268,7 @@ bool Staff::UpdateFixingMoveToStationEnd(bool firstRun, const Ride* ride)
|
|||
{
|
||||
if (!firstRun)
|
||||
{
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -2354,7 +2354,7 @@ bool Staff::UpdateFixingMoveToStationStart(bool firstRun, const Ride* ride)
|
|||
{
|
||||
if (!firstRun)
|
||||
{
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -2430,7 +2430,7 @@ bool Staff::UpdateFixingFixStationStart(bool firstRun, const Ride* ride)
|
|||
{
|
||||
if (!firstRun)
|
||||
{
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION | RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -807,7 +807,7 @@ void Ride::FormatStatusTo(Formatter& ft) const
|
|||
}
|
||||
else if (status == RIDE_STATUS_CLOSED)
|
||||
{
|
||||
if (!ride_type_has_flag(type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (!GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
if (num_riders != 0)
|
||||
{
|
||||
|
@ -848,7 +848,7 @@ void Ride::FormatStatusTo(Formatter& ft) const
|
|||
ft.Add<rct_string_id>(STR_NONE);
|
||||
}
|
||||
}
|
||||
else if (!ride_type_has_flag(type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
else if (!GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
{
|
||||
ft.Add<rct_string_id>(num_riders == 1 ? STR_PERSON_ON_RIDE : STR_PEOPLE_ON_RIDE);
|
||||
ft.Add<uint16_t>(num_riders);
|
||||
|
@ -1480,7 +1480,7 @@ void ride_construction_set_default_next_piece()
|
|||
tileElement = trackBeginEnd.begin_element;
|
||||
trackType = tileElement->AsTrack()->GetTrackType();
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
ride_construction_reset_current_piece();
|
||||
return;
|
||||
|
@ -1854,7 +1854,7 @@ bool ride_modify(CoordsXYE* input)
|
|||
return ride_modify_maze(tileElement);
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS))
|
||||
{
|
||||
CoordsXYE endOfTrackElement{};
|
||||
if (ride_find_track_gap(ride, &tileElement, &endOfTrackElement))
|
||||
|
@ -1880,7 +1880,7 @@ bool ride_modify(CoordsXYE* input)
|
|||
_rideConstructionNextArrowPulse = 0;
|
||||
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
window_ride_construction_update_active_elements();
|
||||
return true;
|
||||
|
@ -3195,7 +3195,7 @@ void ride_check_all_reachable()
|
|||
if (ride.status != RIDE_STATUS_OPEN || ride.connected_message_throttle != 0)
|
||||
continue;
|
||||
|
||||
if (ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
ride_shop_connected(&ride);
|
||||
else
|
||||
ride_entrance_exit_connected(&ride);
|
||||
|
@ -3549,7 +3549,7 @@ static StationIndex ride_mode_check_station_present(Ride* ride)
|
|||
if (stationIndex == STATION_INDEX_NULL)
|
||||
{
|
||||
gGameCommandErrorText = STR_NOT_YET_CONSTRUCTED;
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
return STATION_INDEX_NULL;
|
||||
|
||||
if (ride->type == RIDE_TYPE_MAZE)
|
||||
|
@ -3572,7 +3572,7 @@ static int32_t ride_check_for_entrance_exit(ride_id_t rideIndex)
|
|||
if (ride == nullptr)
|
||||
return 0;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
return 1;
|
||||
|
||||
uint8_t entrance = 0;
|
||||
|
@ -4221,7 +4221,7 @@ static Vehicle* vehicle_create_car(
|
|||
}
|
||||
else
|
||||
{
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
{
|
||||
if (RideTypeDescriptors[ride->type].StartTrackPiece != TrackElemType::FlatTrack1x4B)
|
||||
{
|
||||
|
@ -4472,7 +4472,7 @@ bool Ride::CreateVehicles(const CoordsXYE& element, bool isApplying)
|
|||
}
|
||||
|
||||
//
|
||||
if (type != RIDE_TYPE_SPACE_RINGS && !ride_type_has_flag(type, RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
if (type != RIDE_TYPE_SPACE_RINGS && !GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
{
|
||||
if (IsBlockSectioned())
|
||||
{
|
||||
|
@ -4935,7 +4935,8 @@ bool Ride::Test(int32_t newStatus, bool isApplying)
|
|||
if (isApplying)
|
||||
ride_set_start_finish_points(id, &trackElement);
|
||||
|
||||
if (!ride_type_has_flag(type, RIDE_TYPE_FLAG_NO_VEHICLES) && !(lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
|
||||
const auto& rtd = GetRideTypeDescriptor();
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES) && !(lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
|
||||
{
|
||||
if (!CreateVehicles(trackElement, isApplying))
|
||||
{
|
||||
|
@ -4943,8 +4944,8 @@ bool Ride::Test(int32_t newStatus, bool isApplying)
|
|||
}
|
||||
}
|
||||
|
||||
if ((RideTypeDescriptors[type].Flags & RIDE_TYPE_FLAG_ALLOW_CABLE_LIFT_HILL)
|
||||
&& (lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED) && !(lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT))
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_CABLE_LIFT_HILL) && (lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT_HILL_COMPONENT_USED)
|
||||
&& !(lifecycle_flags & RIDE_LIFECYCLE_CABLE_LIFT))
|
||||
{
|
||||
if (!ride_create_cable_lift(id, isApplying))
|
||||
return false;
|
||||
|
@ -5067,7 +5068,7 @@ bool Ride::Open(bool isApplying)
|
|||
if (isApplying)
|
||||
ride_set_start_finish_points(id, &trackElement);
|
||||
|
||||
if (!ride_type_has_flag(type, RIDE_TYPE_FLAG_NO_VEHICLES) && !(lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
|
||||
if (!GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES) && !(lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK))
|
||||
{
|
||||
if (!CreateVehicles(trackElement, isApplying))
|
||||
{
|
||||
|
@ -5826,7 +5827,7 @@ CoordsXYZD ride_get_entrance_or_exit_position_from_screen_position(const ScreenC
|
|||
return entranceExitCoords;
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
{
|
||||
auto mapX = (word_F4418C & 0x1F) - 16;
|
||||
auto mapY = (word_F4418E & 0x1F) - 16;
|
||||
|
@ -6009,7 +6010,7 @@ bool ride_select_forwards_from_back()
|
|||
*/
|
||||
bool ride_are_all_possible_entrances_and_exits_built(Ride* ride)
|
||||
{
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
return true;
|
||||
|
||||
for (int32_t i = 0; i < MAX_STATIONS; i++)
|
||||
|
@ -6094,7 +6095,7 @@ void ride_fix_breakdown(Ride* ride, int32_t reliabilityIncreaseFactor)
|
|||
*/
|
||||
void ride_update_vehicle_colours(Ride* ride)
|
||||
{
|
||||
if (ride->type == RIDE_TYPE_SPACE_RINGS || ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
if (ride->type == RIDE_TYPE_SPACE_RINGS || ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL))
|
||||
{
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
@ -6586,7 +6587,7 @@ void sub_6CB945(Ride* ride)
|
|||
tileElement->AsTrack()->SetStationIndex(stationId);
|
||||
direction = tileElement->GetDirection();
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
{
|
||||
specialTrack = true;
|
||||
break;
|
||||
|
@ -7334,7 +7335,7 @@ const RideTypeDescriptor& Ride::GetRideTypeDescriptor() const
|
|||
{
|
||||
if (type >= std::size(RideTypeDescriptors))
|
||||
return DummyRTD;
|
||||
|
||||
|
||||
return RideTypeDescriptors[type];
|
||||
}
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ static void ride_ratings_update_state_2()
|
|||
if (tileElement->AsTrack()->GetRideIndex() != ride->id)
|
||||
{
|
||||
// Only check that the track belongs to the same ride if ride does not have buildable track
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -329,7 +329,7 @@ static void ride_ratings_update_state_5()
|
|||
if (tileElement->AsTrack()->GetRideIndex() != ride->id)
|
||||
{
|
||||
// Only check that the track belongs to the same ride if ride does not have buildable track
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -390,7 +390,7 @@ bool track_add_station_element(CoordsXYZD loc, ride_id_t rideIndex, int32_t flag
|
|||
CoordsXY stationFrontLoc = loc;
|
||||
int32_t stationLength = 1;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
{
|
||||
if (ride->num_stations >= MAX_STATIONS)
|
||||
{
|
||||
|
@ -543,7 +543,7 @@ bool track_remove_station_element(const CoordsXYZD& loc, ride_id_t rideIndex, in
|
|||
int32_t stationLength = 0;
|
||||
int32_t byte_F441D1 = -1;
|
||||
|
||||
if (ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION))
|
||||
{
|
||||
TileElement* tileElement = map_get_track_element_at_with_direction_from_ride(loc, rideIndex);
|
||||
if (tileElement != nullptr)
|
||||
|
|
|
@ -1597,7 +1597,7 @@ void Vehicle::UpdateMeasurements()
|
|||
curRide->stations[test_segment].SegmentLength, distance);
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(curRide->type, RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
if (curRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES))
|
||||
{
|
||||
auto gForces = GetGForces();
|
||||
gForces.VerticalG += curRide->previous_vertical_g;
|
||||
|
@ -2358,7 +2358,7 @@ void Vehicle::UpdateWaitingForPassengers()
|
|||
}
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(curRide->type, RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS))
|
||||
if (curRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS))
|
||||
{
|
||||
if (curRide->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH)
|
||||
{
|
||||
|
@ -2403,7 +2403,7 @@ void Vehicle::UpdateWaitingForPassengers()
|
|||
}
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(curRide->type, RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS)
|
||||
if (curRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS)
|
||||
&& curRide->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD)
|
||||
{
|
||||
if (num_peeps_on_train == num_seats_on_train)
|
||||
|
@ -2565,7 +2565,7 @@ void Vehicle::UpdateWaitingToDepart()
|
|||
return;
|
||||
}
|
||||
|
||||
if (ride_type_has_flag(curRide->type, RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS))
|
||||
if (curRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS))
|
||||
{
|
||||
if (curRide->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS)
|
||||
{
|
||||
|
@ -3507,7 +3507,7 @@ void Vehicle::CheckIfMissing()
|
|||
if (curRide->IsBlockSectioned())
|
||||
return;
|
||||
|
||||
if (!ride_type_has_flag(curRide->type, RIDE_TYPE_FLAG_CHECK_FOR_STALLING))
|
||||
if (!curRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CHECK_FOR_STALLING))
|
||||
return;
|
||||
|
||||
lost_time_out++;
|
||||
|
|
|
@ -92,7 +92,7 @@ money32 place_provisional_track_piece(
|
|||
|
||||
int16_t z_begin, z_end;
|
||||
const rct_track_coordinates& coords = TrackCoordinates[trackType];
|
||||
if (!ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_NO_TRACK))
|
||||
{
|
||||
z_begin = coords.z_begin;
|
||||
z_end = coords.z_end;
|
||||
|
|
|
@ -98,7 +98,7 @@ static uint8_t banner_get_ride_index_at(const CoordsXYZ& bannerCoords)
|
|||
|
||||
ride_id_t rideIndex = tileElement->AsTrack()->GetRideIndex();
|
||||
auto ride = get_ride(rideIndex);
|
||||
if (ride == nullptr || ride_type_has_flag(ride->type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride == nullptr || ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
continue;
|
||||
|
||||
if ((tileElement->GetClearanceZ()) + (4 * COORDS_Z_STEP) <= bannerCoords.z)
|
||||
|
@ -242,7 +242,7 @@ uint8_t banner_get_closest_ride_index(const CoordsXYZ& mapPos)
|
|||
auto resultDistance = std::numeric_limits<int32_t>::max();
|
||||
for (auto& ride : GetRideManager())
|
||||
{
|
||||
if (ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_IS_SHOP))
|
||||
if (ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP))
|
||||
continue;
|
||||
|
||||
auto rideCoords = ride.overall_view;
|
||||
|
|
|
@ -578,9 +578,9 @@ uint32_t Park::CalculateSuggestedMaxGuests() const
|
|||
continue;
|
||||
if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED))
|
||||
continue;
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))
|
||||
continue;
|
||||
if (!ride_type_has_flag(ride.type, RIDE_TYPE_FLAG_HAS_DATA_LOGGING))
|
||||
if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_DATA_LOGGING))
|
||||
continue;
|
||||
if (ride.stations[0].SegmentLength < (600 << 16))
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue