Remove TD6 limitations from TrackDesign.cpp

This commit is contained in:
Gymnasiast 2024-07-05 18:36:34 +02:00
parent f5586688ba
commit 1f49b91770
No known key found for this signature in database
GPG key ID: DBFFF47AB2CA3EDD

View file

@ -114,13 +114,10 @@ ResultWithMessage TrackDesign::CreateTrackDesign(TrackDesignState& tds, const Ri
auto object = ObjectEntryGetObject(ObjectType::Ride, ride.subtype); auto object = ObjectEntryGetObject(ObjectType::Ride, ride.subtype);
if (object != nullptr) if (object != nullptr)
{ {
auto entry = object->GetObjectEntry(); if (object->GetGeneration() == ObjectGeneration::DAT)
// Remove this check for new track design format trackAndVehicle.vehicleObject = ObjectEntryDescriptor(object->GetObjectEntry());
if (entry.IsEmpty()) else
{ trackAndVehicle.vehicleObject = ObjectEntryDescriptor(object->GetIdentifier());
return { false, STR_VEHICLE_UNSUPPORTED_TD6 };
}
trackAndVehicle.vehicleObject = ObjectEntryDescriptor(entry);
} }
operation.rideMode = ride.mode; operation.rideMode = ride.mode;
@ -215,12 +212,6 @@ ResultWithMessage TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, con
{ {
const auto& element = trackElement.element->AsTrack(); const auto& element = trackElement.element->AsTrack();
// Remove this check for new track design format
if (element->GetTrackType() > TrackElemType::HighestAlias)
{
return { false, STR_TRACK_ELEM_UNSUPPORTED_TD6 };
}
TrackDesignTrackElement track{}; TrackDesignTrackElement track{};
track.type = element->GetTrackType(); track.type = element->GetTrackType();
track.colourScheme = element->GetColourScheme(); track.colourScheme = element->GetColourScheme();
@ -228,12 +219,6 @@ ResultWithMessage TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, con
track.brakeBoosterSpeed = element->GetBrakeBoosterSpeed(); track.brakeBoosterSpeed = element->GetBrakeBoosterSpeed();
track.seatRotation = element->GetSeatRotation(); track.seatRotation = element->GetSeatRotation();
// This warning will not apply to new track design format
if (track.type == TrackElemType::BlockBrakes && element->GetBrakeBoosterSpeed() != kRCT2DefaultBlockBrakeSpeed)
{
warningMessage = STR_TRACK_DESIGN_BLOCK_BRAKE_SPEED_RESET;
}
if (element->HasChain()) if (element->HasChain())
track.SetFlag(TrackDesignTrackElementFlag::hasChain); track.SetFlag(TrackDesignTrackElementFlag::hasChain);
@ -261,11 +246,6 @@ ResultWithMessage TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, con
} }
trackElement.x = newCoords->x; trackElement.x = newCoords->x;
trackElement.y = newCoords->y; trackElement.y = newCoords->y;
if (trackElements.size() > RCT2::Limits::kTD6MaxTrackElements)
{
return { false, STR_TRACK_TOO_LARGE_OR_TOO_MUCH_SCENERY };
}
} while (trackElement.element != initialMap); } while (trackElement.element != initialMap);
// First entrances, second exits // First entrances, second exits