Part of #13874: Replace piece lengths

This commit is contained in:
frutiemax 2021-08-22 10:11:52 -04:00
parent 716dd3dcb6
commit 780eb4f287
3 changed files with 3 additions and 4 deletions

View File

@ -4909,7 +4909,8 @@ static int32_t ride_get_track_length(Ride* ride)
while (track_circuit_iterator_next(&it))
{
trackType = it.current.element->AsTrack()->GetTrackType();
result += TrackPieceLengths[trackType];
const auto& teDescriptor = GetTrackElementDescriptor(trackType);
result += teDescriptor.PieceLength;
moveSlowIt = !moveSlowIt;
if (moveSlowIt)

View File

@ -2816,7 +2816,7 @@ const rct_preview_track *TrackBlocks[TrackElemType::Count] = {
TrackBlocksFlatTrack3x3,
};
const uint8_t TrackPieceLengths[TrackElemType::Count] = {
const static uint8_t TrackPieceLengths[TrackElemType::Count] = {
32, // TrackElemType::Flat
32, // TrackElemType::EndStation
32, // TrackElemType::BeginStation

View File

@ -21,8 +21,6 @@ extern const uint8_t TrackSequenceProperties[TrackElemType::Count][MaxSequencesP
extern const rct_preview_track* TrackBlocks[TrackElemType::Count];
extern const uint8_t TrackPieceLengths[TrackElemType::Count];
struct track_curve_chain
{
int32_t next;