forked from rosebudai/OpenRCT2-Web
Make all access to RTD table use the bounds checking function
This commit is contained in:
31 files changed
+93
-93
No files matched your search
@@ -633,7 +633,7 @@ static void window_editor_inventions_list_scrollpaint(rct_window* w, rct_drawpix
|
||||
const rct_string_id itemNameId = researchItem.GetName();
|
||||
|
||||
if (researchItem.type == Research::EntryType::Ride
|
||||
&& !RideTypeDescriptors[researchItem.baseRideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
&& !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
const auto rideEntry = get_ride_entry(researchItem.entryIndex);
|
||||
const rct_string_id rideTypeName = get_ride_naming(researchItem.baseRideType, rideEntry).Name;
|
||||
@@ -674,7 +674,7 @@ static void window_editor_inventions_list_drag_open(ResearchItem* researchItem)
|
||||
|
||||
ptr = buffer;
|
||||
if (researchItem->type == Research::EntryType::Ride
|
||||
&& !RideTypeDescriptors[researchItem->baseRideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
&& !GetRideTypeDescriptor(researchItem->baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
const auto rideEntry = get_ride_entry(researchItem->entryIndex);
|
||||
const rct_string_id rideTypeName = get_ride_naming(researchItem->baseRideType, rideEntry).Name;
|
||||
@@ -768,7 +768,7 @@ static std::pair<rct_string_id, Formatter> window_editor_inventions_list_prepare
|
||||
auto ft = Formatter();
|
||||
|
||||
if (researchItem->type == Research::EntryType::Ride
|
||||
&& !RideTypeDescriptors[researchItem->baseRideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
&& !GetRideTypeDescriptor(researchItem->baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
drawString = withGap ? STR_INVENTIONS_LIST_RIDE_AND_VEHICLE_NAME_DRAG : STR_WINDOW_COLOUR_2_STRINGID_STRINGID;
|
||||
rct_string_id rideTypeName = get_ride_naming(researchItem->baseRideType, get_ride_entry(researchItem->entryIndex)).Name;
|
||||
|
||||
@@ -1318,7 +1318,7 @@ static void editor_load_selected_objects()
|
||||
{
|
||||
rct_ride_entry* rideEntry = get_ride_entry(entryIndex);
|
||||
uint8_t rideType = ride_entry_get_first_non_null_ride_type(rideEntry);
|
||||
ResearchCategory category = static_cast<ResearchCategory>(RideTypeDescriptors[rideType].Category);
|
||||
ResearchCategory category = static_cast<ResearchCategory>(GetRideTypeDescriptor(rideType).Category);
|
||||
research_insert_ride_entry(rideType, entryIndex, category, true);
|
||||
}
|
||||
else if (objectType == ObjectType::SceneryGroup)
|
||||
@@ -1485,7 +1485,7 @@ static bool filter_chunks(const ObjectRepositoryItem* item)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (_filter_flags & (1 << (RideTypeDescriptors[rideType].Category + _numSourceGameItems))) != 0;
|
||||
return (_filter_flags & (1 << (GetRideTypeDescriptor(rideType).Category + _numSourceGameItems))) != 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -1519,7 +1519,7 @@ static rct_string_id get_ride_type_string_id(const ObjectRepositoryItem* item)
|
||||
uint8_t rideType = item->RideInfo.RideType[i];
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
result = RideTypeDescriptors[rideType].Naming.Name;
|
||||
result = GetRideTypeDescriptor(rideType).Naming.Name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ static void window_install_track_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
else
|
||||
{
|
||||
// Fall back on the technical track name if the vehicle object cannot be loaded
|
||||
ft.Add<rct_string_id>(RideTypeDescriptors[td6->type].Naming.Name);
|
||||
ft.Add<rct_string_id>(GetRideTypeDescriptor(td6->type).Naming.Name);
|
||||
}
|
||||
|
||||
gfx_draw_string_left(dpi, STR_TRACK_DESIGN_TYPE, ft.Data(), COLOUR_BLACK, screenPos);
|
||||
|
||||
@@ -305,7 +305,7 @@ static void window_new_ride_populate_list()
|
||||
if (rideType == RIDE_TYPE_NULL)
|
||||
continue;
|
||||
|
||||
if (RideTypeDescriptors[rideType].Category != currentCategory)
|
||||
if (GetRideTypeDescriptor(rideType).Category != currentCategory)
|
||||
continue;
|
||||
|
||||
nextListItem = window_new_ride_iterate_over_ride_type(rideType, nextListItem);
|
||||
@@ -335,7 +335,7 @@ static RideSelection* window_new_ride_iterate_over_ride_type(uint8_t rideType, R
|
||||
rct_ride_entry* rideEntry = get_ride_entry(rideEntryIndex);
|
||||
|
||||
// Skip if the vehicle isn't the preferred vehicle for this generic track type
|
||||
if (!RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
if (!GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
&& highestVehiclePriority > rideEntry->BuildMenuPriority)
|
||||
{
|
||||
continue;
|
||||
@@ -343,7 +343,7 @@ static RideSelection* window_new_ride_iterate_over_ride_type(uint8_t rideType, R
|
||||
highestVehiclePriority = rideEntry->BuildMenuPriority;
|
||||
|
||||
// Determines how and where to draw a button for this ride type/vehicle.
|
||||
if (RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
// Separate, draw apart
|
||||
allowDrawingOverLastButton = false;
|
||||
@@ -481,7 +481,7 @@ void window_new_ride_focus(RideSelection rideItem)
|
||||
rideEntry = get_ride_entry(rideItem.EntryIndex);
|
||||
uint8_t rideTypeIndex = ride_entry_get_first_non_null_ride_type(rideEntry);
|
||||
|
||||
window_new_ride_set_page(w, RideTypeDescriptors[rideTypeIndex].Category);
|
||||
window_new_ride_set_page(w, GetRideTypeDescriptor(rideTypeIndex).Category);
|
||||
|
||||
for (RideSelection* listItem = _windowNewRideListItems; listItem->Type != RIDE_TYPE_NULL; listItem++)
|
||||
{
|
||||
@@ -876,7 +876,7 @@ static int32_t get_num_track_designs(RideSelection item)
|
||||
|
||||
if (item.Type < 0x80)
|
||||
{
|
||||
if (RideTypeDescriptors[item.Type].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
entryName = get_ride_entry_name(item.EntryIndex);
|
||||
}
|
||||
@@ -942,10 +942,10 @@ static void window_new_ride_paint_ride_information(
|
||||
if (!(gParkFlags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
// Get price of ride
|
||||
int32_t unk2 = RideTypeDescriptors[item.Type].StartTrackPiece;
|
||||
money32 price = RideTypeDescriptors[item.Type].BuildCosts.TrackPrice;
|
||||
int32_t unk2 = GetRideTypeDescriptor(item.Type).StartTrackPiece;
|
||||
money32 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice;
|
||||
price *= TrackPricing[unk2];
|
||||
price = (price >> 17) * 10 * RideTypeDescriptors[item.Type].BuildCosts.PriceEstimateMultiplier;
|
||||
price = (price >> 17) * 10 * GetRideTypeDescriptor(item.Type).BuildCosts.PriceEstimateMultiplier;
|
||||
|
||||
//
|
||||
rct_string_id stringId = STR_NEW_RIDE_COST;
|
||||
@@ -986,7 +986,7 @@ static void window_new_ride_select(rct_window* w)
|
||||
static void window_new_ride_list_vehicles_for(uint8_t rideType, const rct_ride_entry* rideEntry, char* buffer, size_t bufferLen)
|
||||
{
|
||||
std::fill_n(buffer, bufferLen, 0);
|
||||
if (RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1477,7 +1477,7 @@ static void window_park_objective_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
auto rideTypeId = gScenarioObjective.RideId;
|
||||
if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT)
|
||||
{
|
||||
rideTypeString = RideTypeDescriptors[rideTypeId].Naming.Name;
|
||||
rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name;
|
||||
}
|
||||
ft.Add<rct_string_id>(rideTypeString);
|
||||
}
|
||||
|
||||
@@ -325,7 +325,7 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp
|
||||
strings[0] = gResearchNextItem->GetName();
|
||||
if (gResearchNextItem->type == Research::EntryType::Ride)
|
||||
{
|
||||
auto rtd = RideTypeDescriptors[gResearchNextItem->baseRideType];
|
||||
auto rtd = GetRideTypeDescriptor(gResearchNextItem->baseRideType);
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
if (gResearchNextItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
|
||||
@@ -380,7 +380,7 @@ void window_research_development_page_paint(rct_window* w, rct_drawpixelinfo* dp
|
||||
else
|
||||
{
|
||||
lastDevelopmentFormat = STR_RESEARCH_RIDE_LABEL;
|
||||
auto rtd = RideTypeDescriptors[gResearchLastItem->baseRideType];
|
||||
auto rtd = GetRideTypeDescriptor(gResearchLastItem->baseRideType);
|
||||
if (!rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
if (gResearchLastItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
|
||||
|
||||
@@ -2014,7 +2014,7 @@ static rct_string_id get_ride_type_name_for_dropdown(uint8_t rideType)
|
||||
case RIDE_TYPE_59:
|
||||
return STR_RIDE_NAME_59;
|
||||
default:
|
||||
return RideTypeDescriptors[rideType].Naming.Name;
|
||||
return GetRideTypeDescriptor(rideType).Naming.Name;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3443,7 +3443,7 @@ static void window_ride_operating_invalidate(rct_window* w)
|
||||
bool hasAlternativeType = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE);
|
||||
if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_LIFT_HILL)
|
||||
|| (hasAlternativeType
|
||||
&& RideTypeDescriptors[ride->GetRideTypeDescriptor().AlternateType].SupportsTrackPiece(TRACK_LIFT_HILL)))
|
||||
&& GetRideTypeDescriptor(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;
|
||||
@@ -3828,7 +3828,7 @@ static void window_ride_maintenance_mousedown(rct_window* w, rct_widgetindex wid
|
||||
for (int32_t i = 0; i < 8; i++)
|
||||
{
|
||||
assert(j < static_cast<int32_t>(std::size(rideEntry->ride_type)));
|
||||
if (RideTypeDescriptors[rideEntry->ride_type[j]].AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
{
|
||||
if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned())
|
||||
{
|
||||
@@ -3856,7 +3856,7 @@ static void window_ride_maintenance_mousedown(rct_window* w, rct_widgetindex wid
|
||||
{
|
||||
for (int32_t i = 0; i < 8; i++)
|
||||
{
|
||||
if (RideTypeDescriptors[rideEntry->ride_type[j]].AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
{
|
||||
if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned())
|
||||
{
|
||||
@@ -3971,7 +3971,7 @@ static void window_ride_maintenance_dropdown(rct_window* w, rct_widgetindex widg
|
||||
for (i = 0; i < BREAKDOWN_COUNT; i++)
|
||||
{
|
||||
assert(j < static_cast<int32_t>(std::size(rideEntry->ride_type)));
|
||||
if (RideTypeDescriptors[rideEntry->ride_type[j]].AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns & static_cast<uint8_t>(1 << i))
|
||||
{
|
||||
if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned())
|
||||
{
|
||||
|
||||
@@ -2518,7 +2518,7 @@ void window_ride_construction_update_enabled_track_pieces()
|
||||
return;
|
||||
|
||||
int32_t rideType = ride_get_alternative_type(ride);
|
||||
_enabledRidePieces = RideTypeDescriptors[rideType].GetAvailableTrackPieces();
|
||||
_enabledRidePieces = GetRideTypeDescriptor(rideType).GetAvailableTrackPieces();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2868,7 +2868,7 @@ static void window_ride_construction_update_widgets(rct_window* w)
|
||||
window_ride_construction_widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].image = SPR_RIDE_CONSTRUCTION_SLOPE_UP_STEEP;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP;
|
||||
if (RideTypeDescriptors[rideType].SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
if (GetRideTypeDescriptor(rideType).SupportsTrackPiece(TRACK_REVERSE_FREEFALL))
|
||||
{
|
||||
window_ride_construction_widgets[WIDX_LEVEL].type = WindowWidgetType::FlatBtn;
|
||||
window_ride_construction_widgets[WIDX_SLOPE_UP].type = WindowWidgetType::FlatBtn;
|
||||
|
||||
@@ -514,7 +514,7 @@ static void window_scenarioselect_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
auto rideTypeId = scenario->objective_arg_3;
|
||||
if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT)
|
||||
{
|
||||
rideTypeString = RideTypeDescriptors[rideTypeId].Naming.Name;
|
||||
rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name;
|
||||
}
|
||||
ft.Add<rct_string_id>(rideTypeString);
|
||||
}
|
||||
|
||||
@@ -760,7 +760,7 @@ static void track_list_load_designs(RideSelection item)
|
||||
std::string entryName;
|
||||
if (item.Type < 0x80)
|
||||
{
|
||||
if (RideTypeDescriptors[item.Type].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
entryName = get_ride_entry_name(item.EntryIndex);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ static void setup_track_designer_objects()
|
||||
{
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
if (RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_SHOW_IN_TRACK_DESIGNER))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_SHOW_IN_TRACK_DESIGNER))
|
||||
{
|
||||
*selectionFlags &= ~OBJECT_SELECTION_FLAG_6;
|
||||
break;
|
||||
|
||||
@@ -75,7 +75,7 @@ GameActions::Result::Ptr MazePlaceTrackAction::Query() const
|
||||
{
|
||||
heightDifference /= COORDS_Z_PER_TINY_Z;
|
||||
|
||||
if (heightDifference > RideTypeDescriptors[RIDE_TYPE_MAZE].Heights.MaxHeight)
|
||||
if (heightDifference > GetRideTypeDescriptor(RIDE_TYPE_MAZE).Heights.MaxHeight)
|
||||
{
|
||||
res->Error = GameActions::Status::TooHigh;
|
||||
res->ErrorMessage = STR_TOO_HIGH_FOR_SUPPORTS;
|
||||
|
||||
@@ -87,7 +87,7 @@ GameActions::Result::Ptr MazeSetTrackAction::Query() const
|
||||
{
|
||||
heightDifference /= COORDS_Z_PER_TINY_Z;
|
||||
|
||||
if (heightDifference > RideTypeDescriptors[RIDE_TYPE_MAZE].Heights.MaxHeight)
|
||||
if (heightDifference > GetRideTypeDescriptor(RIDE_TYPE_MAZE).Heights.MaxHeight)
|
||||
{
|
||||
res->Error = GameActions::Status::TooHigh;
|
||||
res->ErrorMessage = STR_TOO_HIGH_FOR_SUPPORTS;
|
||||
|
||||
@@ -93,7 +93,7 @@ GameActions::Result::Ptr RideCreateAction::Query() const
|
||||
return MakeResult(GameActions::Status::InvalidParameters, STR_INVALID_RIDE_TYPE);
|
||||
}
|
||||
|
||||
const auto& colourPresets = RideTypeDescriptors[_rideType].ColourPresets;
|
||||
const auto& colourPresets = GetRideTypeDescriptor(_rideType).ColourPresets;
|
||||
if (_colour1 >= colourPresets.count)
|
||||
{
|
||||
return MakeResult(GameActions::Status::InvalidParameters, STR_NONE);
|
||||
|
||||
@@ -1099,7 +1099,7 @@ static int32_t cc_load_object(InteractiveConsole& console, const arguments_t& ar
|
||||
rideType = rideEntry->ride_type[j];
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
ResearchCategory category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
ResearchCategory category = GetRideTypeDescriptor(rideType).GetResearchCategory();
|
||||
research_insert_ride_entry(rideType, groupIndex, category, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ void research_finish_item(ResearchItem* researchItem)
|
||||
|
||||
// If a vehicle is the first to be invented for its ride type, show the ride type/group name.
|
||||
// Independently listed vehicles (like all flat rides and shops) should always be announced as such.
|
||||
if (RideTypeDescriptors[base_ride_type].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
if (GetRideTypeDescriptor(base_ride_type).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)
|
||||
|| researchItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE)
|
||||
{
|
||||
RideNaming naming = get_ride_naming(base_ride_type, rideEntry);
|
||||
@@ -469,7 +469,7 @@ void research_populate_list_random()
|
||||
{
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
ResearchCategory category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
ResearchCategory category = GetRideTypeDescriptor(rideType).GetResearchCategory();
|
||||
research_insert_ride_entry(rideType, i, category, researched);
|
||||
}
|
||||
}
|
||||
@@ -508,7 +508,7 @@ void research_insert_ride_entry(ObjectEntryIndex entryIndex, bool researched)
|
||||
{
|
||||
if (rideType != RIDE_TYPE_NULL)
|
||||
{
|
||||
ResearchCategory category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
ResearchCategory category = GetRideTypeDescriptor(rideType).GetResearchCategory();
|
||||
research_insert_ride_entry(rideType, entryIndex, category, researched);
|
||||
}
|
||||
}
|
||||
@@ -945,7 +945,7 @@ static void research_update_first_of_type(ResearchItem* researchItem)
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& rtd = RideTypeDescriptors[rideType];
|
||||
const auto& rtd = GetRideTypeDescriptor(rideType);
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
researchItem->flags |= RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE;
|
||||
@@ -978,7 +978,7 @@ void research_determine_first_of_type()
|
||||
if (rideType >= RIDE_TYPE_COUNT)
|
||||
continue;
|
||||
|
||||
const auto& rtd = RideTypeDescriptors[rideType];
|
||||
const auto& rtd = GetRideTypeDescriptor(rideType);
|
||||
if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@ void RideObject::SetRepositoryItem(ObjectRepositoryItem* item) const
|
||||
{
|
||||
// Find the first non-null ride type, to be used when checking the ride group and determining the category.
|
||||
uint8_t firstRideType = ride_entry_get_first_non_null_ride_type(&_legacyType);
|
||||
uint8_t category = RideTypeDescriptors[firstRideType].Category;
|
||||
uint8_t category = GetRideTypeDescriptor(firstRideType).Category;
|
||||
|
||||
for (int32_t i = 0; i < RCT2_MAX_RIDE_TYPES_PER_RIDE_ENTRY; i++)
|
||||
{
|
||||
|
||||
@@ -847,7 +847,7 @@ private:
|
||||
if (_gameVersion == FILE_VERSION_RCT1)
|
||||
{
|
||||
// Original RCT had no music settings, take default style
|
||||
dst->music = RideTypeDescriptors[dst->type].DefaultMusic;
|
||||
dst->music = GetRideTypeDescriptor(dst->type).DefaultMusic;
|
||||
|
||||
// Only merry-go-round and dodgems had music and used
|
||||
// the same flag as synchronise stations for the option to enable it
|
||||
@@ -2682,7 +2682,7 @@ private:
|
||||
dst->baseRideType = rideType;
|
||||
dst->type = Research::EntryType::Ride;
|
||||
dst->flags = 0;
|
||||
dst->category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
dst->category = GetRideTypeDescriptor(rideType).GetResearchCategory();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2701,7 +2701,7 @@ private:
|
||||
dst->baseRideType = rideType;
|
||||
dst->type = Research::EntryType::Ride;
|
||||
dst->flags = 0;
|
||||
dst->category = RideTypeDescriptors[rideType].GetResearchCategory();
|
||||
dst->category = GetRideTypeDescriptor(rideType).GetResearchCategory();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ private:
|
||||
td->number_of_cars_per_train = td4Base.number_of_cars_per_train;
|
||||
td->min_waiting_time = td4Base.min_waiting_time;
|
||||
td->max_waiting_time = td4Base.max_waiting_time;
|
||||
td->operation_setting = std::min(td4Base.operation_setting, RideTypeDescriptors[td->type].OperatingSettings.MaxValue);
|
||||
td->operation_setting = std::min(td4Base.operation_setting, GetRideTypeDescriptor(td->type).OperatingSettings.MaxValue);
|
||||
td->max_speed = td4Base.max_speed;
|
||||
td->average_speed = td4Base.average_speed;
|
||||
td->ride_length = td4Base.ride_length;
|
||||
@@ -250,7 +250,7 @@ private:
|
||||
td->space_required_y = 255;
|
||||
td->lift_hill_speed = 5;
|
||||
td->num_circuits = 0;
|
||||
td->operation_setting = std::min(td->operation_setting, RideTypeDescriptors[td->type].OperatingSettings.MaxValue);
|
||||
td->operation_setting = std::min(td->operation_setting, GetRideTypeDescriptor(td->type).OperatingSettings.MaxValue);
|
||||
|
||||
if (td->type == RIDE_TYPE_MAZE)
|
||||
{
|
||||
|
||||
@@ -208,8 +208,8 @@ void S6Exporter::Export()
|
||||
// Not used by OpenRCT2 any more, but left in to keep RCT2 export working.
|
||||
for (uint8_t i = 0; i < std::size(RideTypeDescriptors); i++)
|
||||
{
|
||||
researchedTrackPiecesA[i] = (RideTypeDescriptors[i].EnabledTrackPieces) & 0xFFFFFFFFULL;
|
||||
researchedTrackPiecesB[i] = (RideTypeDescriptors[i].EnabledTrackPieces >> 32ULL) & 0xFFFFFFFFULL;
|
||||
researchedTrackPiecesA[i] = (GetRideTypeDescriptor(i).EnabledTrackPieces) & 0xFFFFFFFFULL;
|
||||
researchedTrackPiecesB[i] = (GetRideTypeDescriptor(i).EnabledTrackPieces >> 32ULL) & 0xFFFFFFFFULL;
|
||||
}
|
||||
std::memcpy(_s6.researched_track_types_a, researchedTrackPiecesA, sizeof(_s6.researched_track_types_a));
|
||||
std::memcpy(_s6.researched_track_types_b, researchedTrackPiecesB, sizeof(_s6.researched_track_types_b));
|
||||
@@ -534,7 +534,7 @@ void S6Exporter::ExportRide(rct2_ride* dst, const Ride* src)
|
||||
if (useDefaultName)
|
||||
{
|
||||
// Default name with number
|
||||
dst->name = RideTypeDescriptors[src->type].Naming.Name;
|
||||
dst->name = GetRideTypeDescriptor(src->type).Naming.Name;
|
||||
dst->name_arguments_number = src->default_name_number;
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
td->operation_setting = std::min(td->operation_setting, RideTypeDescriptors[td->type].OperatingSettings.MaxValue);
|
||||
td->operation_setting = std::min(td->operation_setting, GetRideTypeDescriptor(td->type).OperatingSettings.MaxValue);
|
||||
|
||||
if (td->type == RIDE_TYPE_MAZE)
|
||||
{
|
||||
|
||||
@@ -270,7 +270,7 @@ bool Vehicle::CableLiftUpdateTrackMotionForwards()
|
||||
auto unk = CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z } + TrackLocation;
|
||||
|
||||
uint8_t bx = 0;
|
||||
unk.z += RideTypeDescriptors[curRide->type].Heights.VehicleZOffset;
|
||||
unk.z += GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset;
|
||||
if (unk.x != unk_F64E20.x)
|
||||
bx |= (1 << 0);
|
||||
if (unk.y != unk_F64E20.y)
|
||||
@@ -336,7 +336,7 @@ bool Vehicle::CableLiftUpdateTrackMotionBackwards()
|
||||
auto unk = CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z } + TrackLocation;
|
||||
|
||||
uint8_t bx = 0;
|
||||
unk.z += RideTypeDescriptors[curRide->type].Heights.VehicleZOffset;
|
||||
unk.z += GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset;
|
||||
if (unk.x != unk_F64E20.x)
|
||||
bx |= (1 << 0);
|
||||
if (unk.y != unk_F64E20.y)
|
||||
|
||||
+17
-17
@@ -397,7 +397,7 @@ money32 Ride::CalculateIncomePerHour() const
|
||||
priceMinusCost -= GetShopItemDescriptor(currentShopItem).Cost;
|
||||
}
|
||||
|
||||
currentShopItem = (lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? RideTypeDescriptors[type].PhotoItem
|
||||
currentShopItem = (lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? ::GetRideTypeDescriptor(type).PhotoItem
|
||||
: entry->shop_item[1];
|
||||
|
||||
if (currentShopItem != ShopItem::None)
|
||||
@@ -877,7 +877,7 @@ int32_t ride_get_total_time(Ride* ride)
|
||||
|
||||
bool Ride::CanHaveMultipleCircuits() const
|
||||
{
|
||||
if (!(RideTypeDescriptors[type].HasFlag(RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS)))
|
||||
if (!(::GetRideTypeDescriptor(type).HasFlag(RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS)))
|
||||
return false;
|
||||
|
||||
// Only allow circuit or launch modes
|
||||
@@ -2445,7 +2445,7 @@ static int32_t ride_get_new_breakdown_problem(Ride* ride)
|
||||
|
||||
bool Ride::CanBreakDown() const
|
||||
{
|
||||
if (RideTypeDescriptors[type].AvailableBreakdowns == 0)
|
||||
if (::GetRideTypeDescriptor(type).AvailableBreakdowns == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -3069,8 +3069,8 @@ std::pair<RideMeasurement*, OpenRCT2String> Ride::GetMeasurement()
|
||||
else
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[type].NameConvention.vehicle).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[type].NameConvention.station).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(::GetRideTypeDescriptor(type).NameConvention.vehicle).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(::GetRideTypeDescriptor(type).NameConvention.station).singular);
|
||||
return { nullptr, { STR_DATA_LOGGING_WILL_START_WHEN_NEXT_LEAVES, ft } };
|
||||
}
|
||||
}
|
||||
@@ -5076,7 +5076,7 @@ bool Ride::Open(bool isApplying)
|
||||
}
|
||||
}
|
||||
|
||||
if ((RideTypeDescriptors[type].HasFlag(RIDE_TYPE_FLAG_ALLOW_CABLE_LIFT_HILL))
|
||||
if ((::GetRideTypeDescriptor(type).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))
|
||||
@@ -5260,7 +5260,7 @@ int32_t ride_get_random_colour_preset_index(uint8_t ride_type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
const track_colour_preset_list* colourPresets = &RideTypeDescriptors[ride_type].ColourPresets;
|
||||
const track_colour_preset_list* colourPresets = &GetRideTypeDescriptor(ride_type).ColourPresets;
|
||||
|
||||
// 200 attempts to find a colour preset that hasn't already been used in the park for this ride type
|
||||
for (int32_t i = 0; i < 200; i++)
|
||||
@@ -5282,7 +5282,7 @@ int32_t ride_get_random_colour_preset_index(uint8_t ride_type)
|
||||
*/
|
||||
void Ride::SetColourPreset(uint8_t index)
|
||||
{
|
||||
const track_colour_preset_list* colourPresets = &RideTypeDescriptors[type].ColourPresets;
|
||||
const track_colour_preset_list* colourPresets = &::GetRideTypeDescriptor(type).ColourPresets;
|
||||
TrackColour colours = { COLOUR_BLACK, COLOUR_BLACK, COLOUR_BLACK };
|
||||
// Stalls save their default colour in the vehicle settings (since they share a common ride type)
|
||||
if (!IsRide())
|
||||
@@ -5341,9 +5341,9 @@ void Ride::SetNameToDefault()
|
||||
*/
|
||||
RideNaming get_ride_naming(const uint8_t rideType, rct_ride_entry* rideEntry)
|
||||
{
|
||||
if (!RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (!GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
return RideTypeDescriptors[rideType].Naming;
|
||||
return GetRideTypeDescriptor(rideType).Naming;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -6366,7 +6366,7 @@ void Ride::UpdateMaxVehicles()
|
||||
return;
|
||||
|
||||
auto stationLength = (*stationNumTiles * 0x44180) - 0x16B2A;
|
||||
int32_t maxMass = RideTypeDescriptors[type].MaxMass << 8;
|
||||
int32_t maxMass = ::GetRideTypeDescriptor(type).MaxMass << 8;
|
||||
int32_t maxCarsPerTrain = 1;
|
||||
for (int32_t numCars = rideEntry->max_cars_in_train; numCars > 0; numCars--)
|
||||
{
|
||||
@@ -6428,7 +6428,7 @@ void Ride::UpdateMaxVehicles()
|
||||
} while (totalLength <= stationLength);
|
||||
|
||||
if ((mode != RideMode::StationToStation && mode != RideMode::ContinuousCircuit)
|
||||
|| !(RideTypeDescriptors[type].HasFlag(RIDE_TYPE_FLAG_ALLOW_MORE_VEHICLES_THAN_STATION_FITS)))
|
||||
|| !(::GetRideTypeDescriptor(type).HasFlag(RIDE_TYPE_FLAG_ALLOW_MORE_VEHICLES_THAN_STATION_FITS)))
|
||||
{
|
||||
maxNumTrains = std::min(maxNumTrains, 31);
|
||||
}
|
||||
@@ -7015,7 +7015,7 @@ uint8_t ride_entry_get_first_non_null_ride_type(const rct_ride_entry* rideEntry)
|
||||
|
||||
int32_t get_booster_speed(uint8_t rideType, int32_t rawSpeed)
|
||||
{
|
||||
int8_t shiftFactor = RideTypeDescriptors[rideType].OperatingSettings.BoosterSpeedFactor;
|
||||
int8_t shiftFactor = GetRideTypeDescriptor(rideType).OperatingSettings.BoosterSpeedFactor;
|
||||
if (shiftFactor == 0)
|
||||
{
|
||||
return rawSpeed;
|
||||
@@ -7067,7 +7067,7 @@ void fix_invalid_vehicle_sprite_sizes()
|
||||
bool ride_entry_has_category(const rct_ride_entry* rideEntry, uint8_t category)
|
||||
{
|
||||
auto rideType = ride_entry_get_first_non_null_ride_type(rideEntry);
|
||||
return RideTypeDescriptors[rideType].Category == category;
|
||||
return GetRideTypeDescriptor(rideType).Category == category;
|
||||
}
|
||||
|
||||
int32_t ride_get_entry_index(int32_t rideType, int32_t rideSubType)
|
||||
@@ -7095,7 +7095,7 @@ int32_t ride_get_entry_index(int32_t rideType, int32_t rideSubType)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (!GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
subType = rideEntryIndex;
|
||||
break;
|
||||
@@ -7297,8 +7297,8 @@ void Ride::FormatNameTo(Formatter& ft) const
|
||||
}
|
||||
else
|
||||
{
|
||||
auto rideTypeName = RideTypeDescriptors[type].Naming.Name;
|
||||
if (RideTypeDescriptors[type].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
auto rideTypeName = ::GetRideTypeDescriptor(type).Naming.Name;
|
||||
if (::GetRideTypeDescriptor(type).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
{
|
||||
auto rideEntry = GetRideEntry();
|
||||
if (rideEntry != nullptr)
|
||||
|
||||
@@ -4440,7 +4440,7 @@ void ride_ratings_calculate_single_rail_roller_coaster(Ride* ride)
|
||||
|
||||
ride_ratings_calculation ride_ratings_get_calculate_func(uint8_t rideType)
|
||||
{
|
||||
return RideTypeDescriptors[rideType].RatingsCalculationFunction;
|
||||
return GetRideTypeDescriptor(rideType).RatingsCalculationFunction;
|
||||
}
|
||||
|
||||
#pragma endregion
|
||||
@@ -853,7 +853,7 @@ roll_type_t track_get_actual_bank(TileElement* tileElement, roll_type_t bank)
|
||||
|
||||
roll_type_t track_get_actual_bank_2(int32_t rideType, bool isInverted, roll_type_t bank)
|
||||
{
|
||||
if (RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
{
|
||||
if (isInverted)
|
||||
{
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
{
|
||||
const ObjectRepositoryItem* ori = repo.FindObjectLegacy(item.ObjectEntry.c_str());
|
||||
|
||||
if (ori == nullptr || !RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (ori == nullptr || !GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
entryIsNotSeparate = true;
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public:
|
||||
{
|
||||
const ObjectRepositoryItem* ori = repo.FindObjectLegacy(item.ObjectEntry.c_str());
|
||||
|
||||
if (ori == nullptr || !RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
if (ori == nullptr || !GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
||||
entryIsNotSeparate = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1970,7 +1970,7 @@ void Vehicle::GetLiftHillSound(Ride* curRide, SoundIdVolume& curSound)
|
||||
if (curRide->type < std::size(RideTypeDescriptors))
|
||||
{
|
||||
// Get lift hill sound
|
||||
curSound.id = RideTypeDescriptors[curRide->type].LiftData.sound_id;
|
||||
curSound.id = GetRideTypeDescriptor(curRide->type).LiftData.sound_id;
|
||||
curSound.volume = 243;
|
||||
if (!(sound2_flags & VEHICLE_SOUND2_FLAGS_LIFT_HILL))
|
||||
curSound.id = OpenRCT2::Audio::SoundId::Null;
|
||||
@@ -3524,7 +3524,7 @@ void Vehicle::CheckIfMissing()
|
||||
if (gConfigNotifications.ride_stalled_vehicles)
|
||||
{
|
||||
Formatter ft;
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[curRide->type].NameConvention.vehicle).number);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).number);
|
||||
|
||||
uint8_t vehicleIndex = 0;
|
||||
for (; vehicleIndex < curRide->num_vehicles; ++vehicleIndex)
|
||||
@@ -3534,7 +3534,7 @@ void Vehicle::CheckIfMissing()
|
||||
vehicleIndex++;
|
||||
ft.Add<uint16_t>(vehicleIndex);
|
||||
curRide->FormatNameTo(ft);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[curRide->type].NameConvention.station).singular);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.station).singular);
|
||||
|
||||
News::AddItemToQueue(News::ItemType::Ride, STR_NEWS_VEHICLE_HAS_STALLED, ride, ft);
|
||||
}
|
||||
@@ -4019,7 +4019,7 @@ void Vehicle::UpdateArriving()
|
||||
goto loc_6D8E36;
|
||||
}
|
||||
|
||||
if (RideTypeDescriptors[curRide->type].HasFlag(RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS)
|
||||
if (GetRideTypeDescriptor(curRide->type).HasFlag(RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS)
|
||||
&& curRide->mode != RideMode::Shuttle && curRide->mode != RideMode::PoweredLaunch)
|
||||
{
|
||||
SetUpdateFlag(VEHICLE_UPDATE_FLAG_12);
|
||||
@@ -6263,7 +6263,7 @@ void Vehicle::SetMapToolbar() const
|
||||
ft.Add<rct_string_id>(STR_RIDE_MAP_TIP);
|
||||
ft.Add<rct_string_id>(STR_MAP_TOOLTIP_STRINGID_STRINGID);
|
||||
curRide->FormatNameTo(ft);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(RideTypeDescriptors[curRide->type].NameConvention.vehicle).capitalised);
|
||||
ft.Add<rct_string_id>(GetRideComponentName(GetRideTypeDescriptor(curRide->type).NameConvention.vehicle).capitalised);
|
||||
ft.Add<uint16_t>(vehicleIndex + 1);
|
||||
curRide->FormatStatusTo(ft);
|
||||
auto intent = Intent(INTENT_ACTION_SET_MAP_TOOLTIP);
|
||||
@@ -8095,7 +8095,7 @@ bool Vehicle::UpdateTrackMotionForwardsGetNewTrack(uint16_t trackType, Ride* cur
|
||||
ClearUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES);
|
||||
{
|
||||
int32_t rideType = get_ride(tileElement->AsTrack()->GetRideIndex())->type;
|
||||
if (RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
{
|
||||
if (tileElement->AsTrack()->IsInverted())
|
||||
{
|
||||
@@ -8221,7 +8221,7 @@ loc_6DAEB9:
|
||||
auto boosterSpeed = get_booster_speed(curRide->type, (brake_speed << 16));
|
||||
if (boosterSpeed > _vehicleVelocityF64E08)
|
||||
{
|
||||
acceleration = RideTypeDescriptors[curRide->type].OperatingSettings.BoosterAcceleration
|
||||
acceleration = GetRideTypeDescriptor(curRide->type).OperatingSettings.BoosterAcceleration
|
||||
<< 16; //_vehicleVelocityF64E08 * 1.2;
|
||||
}
|
||||
}
|
||||
@@ -8229,7 +8229,7 @@ loc_6DAEB9:
|
||||
if ((trackType == TrackElemType::Flat && curRide->type == RIDE_TYPE_REVERSE_FREEFALL_COASTER)
|
||||
|| (trackType == TrackElemType::PoweredLift))
|
||||
{
|
||||
acceleration = RideTypeDescriptors[curRide->type].OperatingSettings.PoweredLiftAcceleration << 16;
|
||||
acceleration = GetRideTypeDescriptor(curRide->type).OperatingSettings.PoweredLiftAcceleration << 16;
|
||||
}
|
||||
if (trackType == TrackElemType::BrakeForDrop)
|
||||
{
|
||||
@@ -8292,7 +8292,7 @@ loc_6DAEB9:
|
||||
uint8_t moveInfovehicleSpriteType;
|
||||
{
|
||||
auto loc = TrackLocation
|
||||
+ CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z + RideTypeDescriptors[curRide->type].Heights.VehicleZOffset };
|
||||
+ CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z + GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset };
|
||||
|
||||
uint8_t remainingDistanceFlags = 0;
|
||||
if (loc.x != unk_F64E20.x)
|
||||
@@ -8470,7 +8470,7 @@ bool Vehicle::UpdateTrackMotionBackwardsGetNewTrack(uint16_t trackType, Ride* cu
|
||||
|
||||
// Update VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES
|
||||
ClearUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES);
|
||||
if (RideTypeDescriptors[curRide->type].HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
if (GetRideTypeDescriptor(curRide->type).HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
{
|
||||
if (tileElement->AsTrack()->IsInverted())
|
||||
{
|
||||
@@ -8596,7 +8596,7 @@ loc_6DBA33:;
|
||||
auto boosterSpeed = get_booster_speed(curRide->type, (brake_speed << 16));
|
||||
if (boosterSpeed < _vehicleVelocityF64E08)
|
||||
{
|
||||
acceleration = RideTypeDescriptors[curRide->type].OperatingSettings.BoosterAcceleration << 16;
|
||||
acceleration = GetRideTypeDescriptor(curRide->type).OperatingSettings.BoosterAcceleration << 16;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8620,7 +8620,7 @@ loc_6DBA33:;
|
||||
{
|
||||
const rct_vehicle_info* moveInfo = GetMoveInfo();
|
||||
auto loc = TrackLocation
|
||||
+ CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z + RideTypeDescriptors[curRide->type].Heights.VehicleZOffset };
|
||||
+ CoordsXYZ{ moveInfo->x, moveInfo->y, moveInfo->z + GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset };
|
||||
|
||||
uint8_t remainingDistanceFlags = 0;
|
||||
if (loc.x != unk_F64E20.x)
|
||||
@@ -8855,7 +8855,7 @@ loc_6DC476:
|
||||
{
|
||||
int32_t rideType = get_ride(tileElement->AsTrack()->GetRideIndex())->type;
|
||||
ClearUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES);
|
||||
if (RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
{
|
||||
if (tileElement->AsTrack()->IsInverted())
|
||||
{
|
||||
@@ -8983,7 +8983,7 @@ loc_6DC743:
|
||||
|
||||
// loc_6DC8A1
|
||||
trackPos = { TrackLocation.x + moveInfo->x, TrackLocation.y + moveInfo->y,
|
||||
TrackLocation.z + moveInfo->z + RideTypeDescriptors[curRide->type].Heights.VehicleZOffset };
|
||||
TrackLocation.z + moveInfo->z + GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset };
|
||||
|
||||
remaining_distance -= 0x368A;
|
||||
if (remaining_distance < 0)
|
||||
@@ -9066,7 +9066,7 @@ loc_6DCA9A:
|
||||
{
|
||||
int32_t rideType = get_ride(tileElement->AsTrack()->GetRideIndex())->type;
|
||||
ClearUpdateFlag(VEHICLE_UPDATE_FLAG_USE_INVERTED_SPRITES);
|
||||
if (RideTypeDescriptors[rideType].HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE))
|
||||
{
|
||||
if (tileElement->AsTrack()->IsInverted())
|
||||
{
|
||||
@@ -9099,7 +9099,7 @@ loc_6DCA9A:
|
||||
loc_6DCC2C:
|
||||
moveInfo = GetMoveInfo();
|
||||
trackPos = { TrackLocation.x + moveInfo->x, TrackLocation.y + moveInfo->y,
|
||||
TrackLocation.z + moveInfo->z + RideTypeDescriptors[curRide->type].Heights.VehicleZOffset };
|
||||
TrackLocation.z + moveInfo->z + GetRideTypeDescriptor(curRide->type).Heights.VehicleZOffset };
|
||||
|
||||
remaining_distance -= 0x368A;
|
||||
if (remaining_distance < 0)
|
||||
@@ -9799,7 +9799,7 @@ void Vehicle::UpdateCrossings() const
|
||||
// Many New Element parks have invisible rides hacked into the path.
|
||||
// Limit path blocking to rides actually supporting level crossings to prevent peeps getting stuck everywhere.
|
||||
if (pathElement && curRide != nullptr
|
||||
&& RideTypeDescriptors[curRide->type].HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS))
|
||||
&& GetRideTypeDescriptor(curRide->type).HasFlag(RIDE_TYPE_FLAG_SUPPORTS_LEVEL_CROSSINGS))
|
||||
{
|
||||
if (!playedClaxon && !pathElement->IsBlockedByVehicle())
|
||||
{
|
||||
|
||||
@@ -867,7 +867,7 @@ void ride_ratings_calculate_single_rail_roller_coaster([[maybe_unused]] Ride* ri
|
||||
|
||||
const RideTypeDescriptor& Ride::GetRideTypeDescriptor() const
|
||||
{
|
||||
return RideTypeDescriptors[type];
|
||||
return GetRideTypeDescriptor(type);
|
||||
}
|
||||
|
||||
uint8_t TileElementBase::GetOwner() const
|
||||
|
||||
@@ -193,7 +193,7 @@ static void CallOriginal(
|
||||
static void CallNew(
|
||||
uint8_t rideType, uint8_t trackType, uint8_t direction, uint8_t trackSequence, uint16_t height, TileElement* tileElement)
|
||||
{
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintFunctionGetter = RideTypeDescriptors[rideType].TrackPaintFunction;
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintFunctionGetter = GetRideTypeDescriptor(rideType).TrackPaintFunction;
|
||||
TRACK_PAINT_FUNCTION newPaintFunction = newPaintFunctionGetter(trackType);
|
||||
|
||||
newPaintFunction(&gPaintSession, 0, trackSequence, direction, height, tileElement);
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Utils
|
||||
|
||||
bool rideSupportsTrackType(uint8_t rideType, uint8_t trackType)
|
||||
{
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintGetter = RideTypeDescriptors[rideType].TrackPaintFunction;
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintGetter = GetRideTypeDescriptor(rideType).TrackPaintFunction;
|
||||
|
||||
if (newPaintGetter == nullptr)
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace Utils
|
||||
|
||||
bool rideIsImplemented(uint8_t rideType)
|
||||
{
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintGetter = RideTypeDescriptors[rideType].TrackPaintFunction;
|
||||
TRACK_PAINT_FUNCTION_GETTER newPaintGetter = GetRideTypeDescriptor(rideType).TrackPaintFunction;
|
||||
return (newPaintGetter != 0);
|
||||
}
|
||||
} // namespace Utils
|
||||
@@ -522,7 +522,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
|
||||
{
|
||||
testCase.trackTypes.push_back(RideTypeDescriptors[rideType].StartTrackPiece);
|
||||
testCase.trackTypes.push_back(GetRideTypeDescriptor(rideType).StartTrackPiece);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user