1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-19 21:13:05 +01:00

Add additional explanation + fix for flat ride vehicles on track

This commit is contained in:
Gymnasiast
2021-10-21 22:41:17 +02:00
parent afb49dfe38
commit 59e73f9cfb

View File

@@ -546,6 +546,17 @@ public:
}
}
/**
* This code is needed to detect hacks where a tracked ride has been made invisible
* by setting its ride type to a flat ride.
*
* The function should classify rides as follows:
* 1. If the ride type is tracked and its vehicles also belong on tracks, it should be classified as tracked.
* 2. If the ride type is a flat ride, but its vehicles belong on tracks,
* it should be classified as tracked (Crooked House mod).
* 3. If the ride type is tracked and its vehicles belong to a flat ride, it should be classified as tracked.
* 4. If the ride type is a flat ride and its vehicles also belong to a flat ride, it should be classified as a flat ride.
*/
void DetermineFlatRideStatus()
{
for (uint8_t index = 0; index < RCT12_MAX_RIDES_IN_PARK; index++)
@@ -556,9 +567,15 @@ public:
auto subtype = RCTEntryIndexToOpenRCT2EntryIndex(src->subtype);
auto* rideEntry = get_ride_entry(subtype);
// If the ride is tracked, we dont need to check the vehicle any more.
if (!GetRideTypeDescriptor(src->type).HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))
{
_isFlatRide[index] = false;
continue;
}
// This code is needed to detect hacks where a tracked ride has been made invisible
// by setting its ride type to a flat ride.
// We have established the ride type is a flat ride, which means the vehicle now determines whether it is a
// true flat ride (scenario 4) or a tracked ride with an invisibility hack (scenario 2).
ObjectEntryIndex originalRideType = src->type;
if (rideEntry != nullptr)
{