1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 15:24:30 +01:00

Use 16-bit ride_id_t thoughout and raise RIDE_ID_NULL (#14411)

* Replace RIDE_ENTRY_INDEX_NULL with OBJECT_ENTRY_INDEX_NULL

Ride entries are objects like any other, so there is little point having separate constants.

* Use ride_id_t in many more places

* Change RIDE_ID_NULL to 0xFFFF

* Increment network version

* Update replays

Co-authored-by: duncanspumpkin <duncans_pumpkin@hotmail.co.uk>
This commit is contained in:
Michael Steenbeek
2021-04-01 17:02:57 +02:00
committed by GitHub
parent cbefc4fe38
commit 7344b7fbfd
32 changed files with 80 additions and 81 deletions

View File

@@ -4430,7 +4430,7 @@ static void ride_create_vehicles_find_first_block(Ride* ride, CoordsXYE* outXYEl
bool Ride::CreateVehicles(const CoordsXYE& element, bool isApplying)
{
UpdateMaxVehicles();
if (subtype == RIDE_ENTRY_INDEX_NULL)
if (subtype == OBJECT_ENTRY_INDEX_NULL)
{
return true;
}
@@ -4889,7 +4889,7 @@ bool Ride::Test(int32_t newStatus, bool isApplying)
}
}
if (subtype != RIDE_ENTRY_INDEX_NULL && !gCheatsEnableAllDrawableTrackPieces)
if (subtype != OBJECT_ENTRY_INDEX_NULL && !gCheatsEnableAllDrawableTrackPieces)
{
rct_ride_entry* rideType = get_ride_entry(subtype);
if (rideType->flags & RIDE_ENTRY_FLAG_NO_INVERSIONS)
@@ -5022,7 +5022,7 @@ bool Ride::Open(bool isApplying)
}
}
if (subtype != RIDE_ENTRY_INDEX_NULL && !gCheatsEnableAllDrawableTrackPieces)
if (subtype != OBJECT_ENTRY_INDEX_NULL && !gCheatsEnableAllDrawableTrackPieces)
{
rct_ride_entry* rideEntry = get_ride_entry(subtype);
if (rideEntry->flags & RIDE_ENTRY_FLAG_NO_INVERSIONS)
@@ -6344,7 +6344,7 @@ static int32_t ride_get_track_length(Ride* ride)
*/
void Ride::UpdateMaxVehicles()
{
if (subtype == RIDE_ENTRY_INDEX_NULL)
if (subtype == OBJECT_ENTRY_INDEX_NULL)
return;
rct_ride_entry* rideEntry = get_ride_entry(subtype);
@@ -7077,7 +7077,7 @@ int32_t ride_get_entry_index(int32_t rideType, int32_t rideSubType)
{
int32_t subType = rideSubType;
if (subType == RIDE_ENTRY_INDEX_NULL)
if (subType == OBJECT_ENTRY_INDEX_NULL)
{
auto& objManager = GetContext()->GetObjectManager();
auto& rideEntries = objManager.GetAllRideEntries(rideType);
@@ -7089,7 +7089,7 @@ int32_t ride_get_entry_index(int32_t rideType, int32_t rideSubType)
auto rideEntry = get_ride_entry(rideEntryIndex);
if (rideEntry == nullptr)
{
return RIDE_ENTRY_INDEX_NULL;
return OBJECT_ENTRY_INDEX_NULL;
}
// Can happen in select-by-track-type mode