Put .DAT fixes into their own method, fix max cars on the Crocodile Ride

This commit is contained in:
Gymnasiast 2017-06-23 17:29:51 +02:00
parent 234bedb8b8
commit db091032cc
2 changed files with 22 additions and 15 deletions

View File

@ -77,16 +77,6 @@ void RideObject::ReadLegacy(IReadObjectContext * context, IStream * stream)
GetStringTable()->Read(context, stream, OBJ_STRING_ID_NAME);
GetStringTable()->Read(context, stream, OBJ_STRING_ID_DESCRIPTION);
// Add boosters if the track type is eligible
for (sint32 i = 0; i < MAX_RIDE_TYPES_PER_RIDE_ENTRY; i++)
{
if (ride_type_supports_boosters(_legacyType.ride_type[i]))
{
_legacyType.enabledTrackPieces |= (1ULL << TRACK_BOOSTER);
}
}
GetStringTable()->Read(context, stream, OBJ_STRING_ID_CAPACITY);
// Read preset colours, by default there are 32
@ -133,7 +123,7 @@ void RideObject::ReadLegacy(IReadObjectContext * context, IStream * stream)
context->LogError(OBJECT_ERROR_INVALID_PROPERTY, "Nausea multiplier too high.");
}
PerformRCT1CompatibilityFixes();
PerformFixes();
}
void RideObject::Load()
@ -480,10 +470,27 @@ void RideObject::ReadLegacyVehicle(IReadObjectContext * context, IStream * strea
stream->Seek(4, STREAM_SEEK_CURRENT);
}
void RideObject::PerformRCT1CompatibilityFixes()
void RideObject::PerformFixes()
{
if (String::Equals(GetIdentifier(), "RCKC ")) {
// The rocket cars could take 3 cars per train in RCT1. Restore this.
std::string identifier = GetIdentifier();
// Add boosters if the track type is eligible
for (sint32 i = 0; i < MAX_RIDE_TYPES_PER_RIDE_ENTRY; i++)
{
if (ride_type_supports_boosters(_legacyType.ride_type[i]))
{
_legacyType.enabledTrackPieces |= (1ULL << TRACK_BOOSTER);
}
}
// The rocket cars could take 3 cars per train in RCT1. Restore this.
if (String::Equals(identifier, "RCKC "))
{
_legacyType.max_cars_in_train = 3 + _legacyType.zero_cars;
}
// Wacky World Crocodile Ride (a log flume vehicle) is incorrectly locked to 5 cars.
else if (String::Equals(identifier, "CROCFLUM"))
{
_legacyType.cars_per_flat_ride = 0xFF;
}
}

View File

@ -50,5 +50,5 @@ public:
private:
void ReadLegacyVehicle(IReadObjectContext * context, IStream * stream, rct_ride_entry_vehicle * vehicle);
void PerformRCT1CompatibilityFixes();
void PerformFixes();
};