mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-16 19:43:06 +01:00
committed by
GitHub
parent
a2f3ab84cc
commit
6c54bacd41
@@ -557,7 +557,16 @@ bool track_block_get_next(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32
|
||||
if (trackBlock == nullptr)
|
||||
return false;
|
||||
|
||||
trackBlock += inputElement->GetSequenceIndex();
|
||||
// The sequence index may be higher than the amount of sequences actually present.
|
||||
// We don’t know the amount of sequences present in the block upfront, but there is an end marker consisting of all 255s.
|
||||
const auto sequenceIndex = inputElement->GetSequenceIndex();
|
||||
for (auto i = 0; i < sequenceIndex; i++)
|
||||
{
|
||||
trackBlock++;
|
||||
|
||||
if (trackBlock == nullptr || trackBlock->index == 255)
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto& trackCoordinate = ted.Coordinates;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user